Skip to main content

ActionInvoker

Struct ActionInvoker 

Source
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

Source

pub fn admitted(acting: &Acting) -> Self

The actor the host admitted.

Source

pub fn member(member: MemberId) -> Self

A member acting for themselves.

Source

pub fn person(id: impl Into<PersonId>) -> Self

A person the host authenticated, acting for themselves.

Source

pub fn agent(id: impl Into<String>, person: impl Into<PersonId>) -> Self

The agent id of person, acting by itself.

Source

pub fn bot(id: impl Into<String>) -> Self

Source

pub fn automation(id: impl Into<String>) -> Self

Source

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.

Source

pub fn with_presence(self, presence: PresenceId) -> Self

Source

pub fn named(self, name: Option<String>) -> Self

The name the admitting host knows this agent by (Self::name).

Source

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.

Source

pub fn acting_for(self, person: impl Into<PersonId>) -> Self

The same invoker, for person. A person acting for themselves records nobody.

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ActionInvoker

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ActionInvoker

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ActionInvoker

Source§

impl Hash for ActionInvoker

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ActionInvoker

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ActionInvoker

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ActionInvoker

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more