pub enum OriginClass {
FirstParty,
ThirdParty,
}Expand description
Trust origin of a schema (or the mem that pins it), decided at adopt/write time and reported — never re-derived — on the read path.
FirstParty is an engine built-in or a schema authored/explicitly
trusted in this workspace. Its prose-instruction fields
(system_context, write_rules, writing_guidance, when_to_use,
prose description, default_writing_guidance) guide authoring in
this workspace and are served in full.
ThirdParty is a schema that arrived from outside this workspace
(registry-installed or adopted from a foreign folder/clone) and has
not been explicitly trusted. Memstead’s value proposition pulls a
mem’s schema directly into a consuming agent’s context, where the
schema’s free-text fields are framed as instructions (“System
context”, “Writing guidance”). A third-party schema is therefore
served structural-only: build_schema_payload forces the
SchemaVerbosity::Lite skeleton regardless of the requested
verbosity, omitting every prose-instruction field. This is lossless
for the legitimate use case — the omitted fields only guide writing,
and a write never targets a foreign mem.
The class is unforgeable by a publisher: it is decided by how the
schema entered the workspace, not by any content the schema carries.
An unknown/ambiguous origin classifies ThirdParty — the safe
default (a stranger’s prose is never served as first-party
instructions on the strength of a missing label).
Variants§
FirstParty
Engine built-in, or authored/explicitly trusted in this workspace.
ThirdParty
Arrived from outside this workspace and not explicitly trusted. The safe default for an unlabelled/ambiguous origin.
Implementations§
Source§impl OriginClass
impl OriginClass
Sourcepub fn as_wire(self) -> &'static str
pub fn as_wire(self) -> &'static str
The wire token for this origin ("first-party" / "third-party"),
emitted on every schema read so a consuming host can quarantine
non-first-party content.
Sourcepub fn is_third_party(self) -> bool
pub fn is_third_party(self) -> bool
Whether this origin must have its schema served structural-only (prose-instruction fields omitted) on the read path.
Trait Implementations§
Source§impl Clone for OriginClass
impl Clone for OriginClass
Source§fn clone(&self) -> OriginClass
fn clone(&self) -> OriginClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OriginClass
Source§impl Debug for OriginClass
impl Debug for OriginClass
Source§impl Default for OriginClass
impl Default for OriginClass
Source§fn default() -> OriginClass
fn default() -> OriginClass
impl Eq for OriginClass
Source§impl PartialEq for OriginClass
impl PartialEq for OriginClass
impl StructuralPartialEq for OriginClass
Auto Trait Implementations§
impl Freeze for OriginClass
impl RefUnwindSafe for OriginClass
impl Send for OriginClass
impl Sync for OriginClass
impl Unpin for OriginClass
impl UnsafeUnpin for OriginClass
impl UnwindSafe for OriginClass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<T> Fruit for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more