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
impl Caller
pub fn authenticated(
user_public_key: [u8; 32],
device_public_key: [u8; 32],
) -> 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
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
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
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
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 bot(
installation: impl Into<String>,
user_public_key: [u8; 32],
device_public_key: [u8; 32],
) -> Caller
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
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 execution_id(&self) -> Option<Uuid>
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)
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
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
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
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 acting_for_person(&self) -> Option<&str>
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
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 actor(&self) -> InteractionActor
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_room(self, room: impl Into<String>) -> Caller
pub fn in_room(self, room: impl Into<String>) -> Caller
Confine the caller to one room: the connection was admitted to that room only, so nothing outside it is offered or reachable.
pub const fn principal(&self) -> &CallerPrincipal
pub const fn user_public_key(&self) -> Option<&[u8; 32]>
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 is_foreign_device(&self) -> bool
Whether the caller acts from a foreign device.
pub const fn device_public_key(&self) -> Option<&[u8; 32]>
pub const fn device_public_key(&self) -> Option<&[u8; 32]>
The remote device that sent the request.
Trait Implementations§
impl Eq for Caller
impl StructuralPartialEq for Caller
Auto Trait Implementations§
impl Freeze for Caller
impl RefUnwindSafe for Caller
impl Send for Caller
impl Sync for Caller
impl Unpin for Caller
impl UnsafeUnpin for Caller
impl UnwindSafe for Caller
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq 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> 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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