pub(crate) enum SelfOwner<'a> {
Uid(&'a str),
Slug(&'a str),
}Expand description
The agent a self-scoped MuxAPI call is about — whose personal memory
(memory.*, M4c-2b), linked accounts (identity.self.accounts,
identity.account.validate), bound preset (preset.get self) and
history (history.search, M4c-2c) — identity spec §6.5.9.
Variants§
Uid(&'a str)
The calling agent’s own row, by its token’s UID. Versions are keyed by
it as they are; the files are found by id
(memory_dir_for_agent_by_id), and a UID with no row or no directory
is an error — never another agent’s directory (the #2901 class). A
directory that resolves but does not exist still lists as empty, as
on the slug path.
Slug(&'a str)
A slug, resolved as before M4c-2 (memory_dir_for_agent,
resolve_agent_id, the registry by slug): an Unattributed HTTP
caller, and the WS RPC.
Implementations§
Source§impl<'a> SelfOwner<'a>
impl<'a> SelfOwner<'a>
Sourcepub(crate) fn of(
caller: Option<&'a Caller>,
slug: &'a str,
by_name_counter: &'static str,
) -> Self
pub(crate) fn of( caller: Option<&'a Caller>, slug: &'a str, by_name_counter: &'static str, ) -> Self
The owner of an HTTP request: the caller’s own row when attributed,
whatever agent_id names — a name that is not the caller’s is counted
by M4a-2 — so a name two agents share no longer selects the other’s
memory, accounts or history. An Unattributed request keeps the slug, counted as
by_name_counter.
Sourcepub(crate) fn caller_row(
uid: &str,
mstore: &Store,
) -> Result<AgentDefinition, String>
pub(crate) fn caller_row( uid: &str, mstore: &Store, ) -> Result<AgentDefinition, String>
The calling agent’s row — a UID whose row is gone (a token that outlived its agent) is an error on every path, never an empty history or listing (ReAgent P1 on #3602).
Sourcepub(super) fn dir(self, mstore: &Store) -> Result<PathBuf, String>
pub(super) fn dir(self, mstore: &Store) -> Result<PathBuf, String>
The owner’s live memory directory.
Trait Implementations§
impl<'a> Copy for SelfOwner<'a>
Auto Trait Implementations§
impl<'a> Freeze for SelfOwner<'a>
impl<'a> RefUnwindSafe for SelfOwner<'a>
impl<'a> Send for SelfOwner<'a>
impl<'a> Sync for SelfOwner<'a>
impl<'a> Unpin for SelfOwner<'a>
impl<'a> UnsafeUnpin for SelfOwner<'a>
impl<'a> UnwindSafe for SelfOwner<'a>
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§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>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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