Skip to main content

Caller

Struct Caller 

pub struct Caller { /* private fields */ }
Expand description

The authenticated principal behind a request.

Built only by the transport that authenticated the connection — from the certificate chain a peer presented, or from the admitted identity of a local connection. It is deliberately not Deserialize: a payload cannot assert who sent it.

Implementations§

§

impl Caller

pub fn within(self, reach: Reach) -> Caller

The same caller, asking as part of an invocation admitted to reach reach: what goes further runs only once the person confirmed it. It only narrows. Set only by the host that matched the request to the invocation it continues, never from a payload.

pub const fn ceiling(&self) -> Option<Reach>

How far this caller’s requests reach without the person being asked, when they continue an invocation (Self::within).

§

impl Caller

pub fn authenticated( user_public_key: [u8; 32], device_public_key: [u8; 32], ) -> Caller

A remote device whose certificate the transport verified to chain to user_public_key.

pub fn local_person(principal: impl Into<String>) -> Caller

A person on a connection the host admitted itself, by the policy principal id that admission established.

pub fn local_agent(agent_id: impl Into<String>) -> Caller

A delegated agent on a connection the host admitted itself.

pub fn local_app(app_id: impl Into<String>) -> Caller

An application on a connection the host admitted itself, by the package id that admission established. It holds no role of its own: it may use only what it owns and what a workspace grants it.

pub fn delegated_agent( agent_id: impl Into<String>, user_public_key: [u8; 32], device_public_key: [u8; 32], ) -> Caller

A remote agent device whose certificate the transport verified to chain to user_public_key and whose root-signed delegation names it agent agent_id. It is its own principal, never the person who delegated it.

pub fn agent_turn( agent_id: impl Into<String>, person: impl Into<String>, turn: Turn, ) -> Caller

An agent acting inside a turn: person’s message in turn’s conversation caused it, and the agent takes part there. It may do exactly what that person may, held to the editor preset and to the bound its own record carries, and nothing outside a turn. Every op it makes carries the turn, so the receiving device checks the cause it arrived with. Set only by the host that admitted the turn.

pub fn bot( installation: impl Into<String>, user_public_key: [u8; 32], device_public_key: [u8; 32], ) -> Caller

A bot device whose certificate chains to user_public_key (its installer) and whose root-signed delegation names it installation installation. It acts for its installer and is never that person.

pub fn in_new_execution(self) -> Caller

Give an already admitted connection its own execution scope. The host mints the identifier; no payload, display name or history run selects it. This changes invocation ownership, never the caller’s permissions.

pub fn in_execution(self, execution: ExecutionLease) -> Caller

Retain a host-issued execution when projecting the same transport into another verified action door. A lease conveys ownership and lifetime, never certificate custody or additional permissions.

pub fn execution_id(&self) -> Option<Uuid>

Host-issued execution identity. An identifier alone conveys no authority.

pub fn execution_lease(&self) -> Option<ExecutionLease>

pub fn execution_is_live(&self) -> bool

pub fn retire_execution(&self)

A transport ends its own run; retained caller clones cannot reopen it.

pub fn from_foreign_device(self, foreign: bool) -> Caller

Mark whether the caller acts from a foreign device: a Tilo runtime on an operating system Tilo does not control, as its certificate says. Workspaces it does not govern cap such a caller’s role.

pub fn acting_for(self, person: impl Into<String>) -> Caller

The caller acts for person, by that person’s policy principal id: an agent, a Shortcut or an app the person started. Set only by the host that admitted the delegation, never from a payload. It names who the actor works for in presence and history; it widens nothing.

pub fn delegated_to(self, agent_id: impl Into<String>) -> Caller

This person’s own device hands the connection to agent agent_id, acting for them: an MCP client, a local assistant. The agent is the principal (its edits, presence and history are the agent’s, for the person) and it may do only what both the person and the delegation a device gives its agents allow. A caller that is not a person is returned as it is. Set only by the host that admitted the person.

pub fn is_session_delegated(&self) -> bool

Whether this agent is one the person’s own device handed its session to (Self::delegated_to): it carries the delegation a device gives its agents. An agent admitted as a member that acts for a person (Self::acting_for) carries only what the workspace grants it.

pub fn turn(&self) -> Option<&Turn>

The turn this agent acts inside (Self::agent_turn), when it was admitted as one: the message whose conversation caused its ops, which every door it reaches decides it against.

pub fn acting_for_person(&self) -> Option<&str>

The person this caller acts for, when it is not that person.

pub fn running_shortcut(self, id: impl Into<String>) -> Caller

The caller’s invocations are the steps of Shortcut id’s run: still the person’s authority (bounded by the Shortcut’s own grants, which the runner applies), but the Shortcut is who acts, for the person. Set only by the host’s Shortcut runner.

pub fn shortcut(&self) -> Option<&str>

The Shortcut whose run this invocation is a step of.

pub fn actor(&self) -> InteractionActor

Who acts, as presence and history name them: the kind of actor, its id, and the person it acts for when that is someone else.

pub fn in_workspace(self, workspace: impl Into<String>) -> Caller

Confine the caller to one workspace: the connection was admitted to that workspace only, so nothing outside it is offered or reachable.

pub const fn principal(&self) -> &CallerPrincipal

pub fn workspace(&self) -> Option<&str>

The workspace this caller is confined to, if any.

pub const fn user_public_key(&self) -> Option<&[u8; 32]>

The user root a remote device chains to.

pub const fn is_foreign_device(&self) -> bool

pub const fn device_public_key(&self) -> Option<&[u8; 32]>

The remote device that sent the request.

Trait Implementations§

§

impl Clone for Caller

§

fn clone(&self) -> Caller

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
§

impl Debug for Caller

§

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

Formats the value using the given formatter. Read more
§

impl Hash for Caller

§

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

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
§

impl PartialEq for Caller

§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl Eq for Caller

§

impl StructuralPartialEq for Caller

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
§

impl<T> AnyEq for T
where T: Any + PartialEq,

§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

§

fn as_any(&self) -> &(dyn Any + 'static)

§

impl<T> AsAny for T
where T: 'static,

§

fn as_any(&self) -> &(dyn Any + 'static)

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
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &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)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> CommonTraits for T
where T: AsAny + Any + Debug + WasmNotSendSync,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Fruit for T
where T: Send + Downcast,

§

impl<T> MaybeSendSync for T
where T: Send + Sync + ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T

§

impl<T> WasmNotSync for T
where T: Sync,