pub enum MemoryScope {
Private,
Team,
Unit,
Org,
Collective,
}Expand description
v0.7.0 multi-agent literal-sweep (scanner B, finding F-B2.x) — typed
closed-set discriminator for memory.metadata.scope (Task 1.5).
Paired with the VALID_SCOPES string allowlist + the validator
at crate::validate::validate_scope; the parity test
tests/memory_scope_count_invariant.rs asserts both stay in
lockstep.
#[serde(rename_all = "snake_case")] keeps the wire shape and the
existing metadata.scope JSON column byte-identical to what every
v0.6.x / v0.7.x writer already emits ("private", "team", etc.).
Variants§
Private
Memory is visible only to its owning agent within its own namespace. The default for unmarked rows (per the query layer).
Team
Memory is visible to every agent whose namespace falls within
the same team subtree. Subtree matching honours
MAX_NAMESPACE_DEPTH.
Unit
Memory is visible to every agent within the same unit subtree.
Org
Memory is visible to every agent within the same org subtree.
Collective
Memory is visible to every authenticated caller, regardless of namespace.
Implementations§
Source§impl MemoryScope
impl MemoryScope
Sourcepub const COUNT: usize = 5
pub const COUNT: usize = 5
Total number of MemoryScope variants. SSOT for the
“5 visibility scopes at v0.7.0” narrative across docs.
Adding a new variant requires bumping this const, the
VALID_SCOPES slice, the Self::as_str / Self::from_str
match arms, and the visibility-policy dispatch in
src/storage/mod.rs::is_visible.
Sourcepub const fn all() -> &'static [Self; 5]
pub const fn all() -> &'static [Self; 5]
Canonical enumeration in declaration order
(private, team, unit, org, collective). Use this
anywhere external code would otherwise hand-roll the list —
federation handshake, capability advertisement, parity tests.
Sourcepub const fn all_strs() -> &'static [&'static str; 5]
pub const fn all_strs() -> &'static [&'static str; 5]
String enumeration matching VALID_SCOPES byte-for-byte.
Parity-test-asserted against the VALID_SCOPES const.
Sourcepub fn from_str(s: &str) -> Option<Self>
pub fn from_str(s: &str) -> Option<Self>
Parse the string form stored in metadata.scope.
Returns None for unknown values so callers can decide whether
to default to Self::Private (the query-layer convention for
unmarked rows) or surface a typed error.
Trait Implementations§
Source§impl Clone for MemoryScope
impl Clone for MemoryScope
Source§fn clone(&self) -> MemoryScope
fn clone(&self) -> MemoryScope
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 MemoryScope
Source§impl Debug for MemoryScope
impl Debug for MemoryScope
Source§impl Default for MemoryScope
impl Default for MemoryScope
Source§impl<'de> Deserialize<'de> for MemoryScope
impl<'de> Deserialize<'de> for MemoryScope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for MemoryScope
impl Display for MemoryScope
impl Eq for MemoryScope
Source§impl FromStr for MemoryScope
impl FromStr for MemoryScope
Source§impl Hash for MemoryScope
impl Hash for MemoryScope
Source§impl PartialEq for MemoryScope
impl PartialEq for MemoryScope
Source§fn eq(&self, other: &MemoryScope) -> bool
fn eq(&self, other: &MemoryScope) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for MemoryScope
impl Serialize for MemoryScope
impl StructuralPartialEq for MemoryScope
Auto Trait Implementations§
impl Freeze for MemoryScope
impl RefUnwindSafe for MemoryScope
impl Send for MemoryScope
impl Sync for MemoryScope
impl Unpin for MemoryScope
impl UnsafeUnpin for MemoryScope
impl UnwindSafe for MemoryScope
Blanket Implementations§
impl<T> Boilerplate for T
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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§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> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.