pub struct ActionInvoker {
pub acting: Acting,
pub presence: Option<PresenceId>,
pub appearance: Option<Appearance>,
pub name: Option<String>,
pub device: Option<InvokerDevice>,
}Expand description
The invoker of one action: the authenticated acting tree, and optionally the presence whose view the invocation resolves against.
presence: None means the actor’s single/default view (the local
window for a person; the only view of a single-view app).
Fields§
§acting: Acting§presence: Option<PresenceId>§appearance: Option<Appearance>The name and avatar a bot showed for this action. Set only by the API that admitted the invocation, and only for a bot allowed it.
name: Option<String>The name an agent goes by: the name its harness gave the session it works in (“Release prep”), else the one the host that admitted it knows from the key its person certified for it (“Jane Doe’s agent”). What History and a message’s byline name it by; display only, never authority.
device: Option<InvokerDevice>The other device of its person’s an agent works from, when it came to
this host through its MCP server. Set only by the host that admitted
the connection, from the device certificate the API verified, and
never taken from a request. None for an actor on the host’s own
device.
Implementations§
Source§impl ActionInvoker
impl ActionInvoker
Sourcepub fn person(id: impl Into<PersonId>) -> Self
pub fn person(id: impl Into<PersonId>) -> Self
A person the host authenticated, acting for themselves.
Sourcepub fn agent(id: impl Into<String>, person: impl Into<PersonId>) -> Self
pub fn agent(id: impl Into<String>, person: impl Into<PersonId>) -> Self
The agent id of person, acting by itself.
pub fn bot(id: impl Into<String>) -> Self
pub fn automation(id: impl Into<String>) -> Self
Sourcepub fn view(&self) -> Option<PresenceId>
pub fn view(&self) -> Option<PresenceId>
The view the invocation resolves against: its presence, else the member’s default view.
None for an automation, which has no view.
pub fn with_presence(self, presence: PresenceId) -> Self
Sourcepub fn named(self, name: Option<String>) -> Self
pub fn named(self, name: Option<String>) -> Self
The name the admitting host knows this agent by (Self::name).
Sourcepub fn from_device(self, device: Option<InvokerDevice>) -> Self
pub fn from_device(self, device: Option<InvokerDevice>) -> Self
The other device of its person’s the agent works from
(Self::device), as the API that admitted its connection verified
it; None clears one, so an invoker copied from a caller’s context
never keeps a device no API checked.
Sourcepub fn acting_for(self, person: impl Into<PersonId>) -> Self
pub fn acting_for(self, person: impl Into<PersonId>) -> Self
The same invoker, for person. A person acting for themselves
records nobody.
Sourcepub fn with_appearance(self, appearance: Option<Appearance>) -> Self
pub fn with_appearance(self, appearance: Option<Appearance>) -> Self
The appearance the API admitted for this one invocation; None
clears one, so an invoker copied from a caller’s context never keeps
what no API checked.
Sourcepub fn delivered(actor: &Actor, context: Option<&ActionContext>) -> Self
pub fn delivered(actor: &Actor, context: Option<&ActionContext>) -> Self
The invoker an application worker may act on for one delivered
invocation. actor is the actor the host authenticated and put on
the delivery; context is the host-built provenance of the same
delivery. The presence, the person it acts for and the device it
works from are kept only when the context names this exact actor, or an
automation acting for exactly that actor. A context the host did not rewrite for this actor
therefore never routes to anybody’s view.
Trait Implementations§
Source§impl Clone for ActionInvoker
impl Clone for ActionInvoker
Source§impl Debug for ActionInvoker
impl Debug for ActionInvoker
Source§impl<'de> Deserialize<'de> for ActionInvoker
impl<'de> Deserialize<'de> for ActionInvoker
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>,
impl Eq for ActionInvoker
Source§impl Hash for ActionInvoker
impl Hash for ActionInvoker
Source§impl PartialEq for ActionInvoker
impl PartialEq for ActionInvoker
Source§impl Serialize for ActionInvoker
impl Serialize for ActionInvoker
impl StructuralPartialEq for ActionInvoker
Auto Trait Implementations§
impl Forget for ActionInvoker
impl Freeze for ActionInvoker
impl Move for ActionInvoker
impl RefUnwindSafe for ActionInvoker
impl Send for ActionInvoker
impl Sync for ActionInvoker
impl Unpin for ActionInvoker
impl UnsafeUnpin for ActionInvoker
impl UnwindSafe for ActionInvoker
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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