pub struct Session { /* private fields */ }Expand description
Session host object owned by the kernel.
Implementations§
Source§impl Session
impl Session
pub fn new( id: SessionId, agent_id: AgentId, issued_capabilities: Vec<CapabilityToken>, ) -> Self
pub fn id(&self) -> &SessionId
pub fn agent_id(&self) -> &str
pub fn state(&self) -> SessionState
pub fn auth_context(&self) -> SessionAuthContext
pub fn session_anchor(&self) -> SessionAnchorState
pub fn session_anchor_snapshot(&self) -> SessionAnchorSnapshot
pub fn request_lineage( &self, request_id: &RequestId, ) -> Option<RequestLineageRecord>
pub fn peer_capabilities(&self) -> PeerCapabilities
pub fn capabilities(&self) -> &[CapabilityToken]
pub fn roots(&self) -> Vec<RootDefinition>
pub fn normalized_roots(&self) -> Vec<NormalizedRoot>
pub fn enforceable_filesystem_roots(&self) -> Vec<NormalizedRoot>
pub fn inflight(&self) -> &InflightRegistry
pub fn mark_execution_nonce_pending( &self, request_id: &RequestId, nonce_id: &str, ) -> Result<(), SessionError>
pub fn validate_execution_nonce_retry( &self, context: &OperationContext, operation_kind: OperationKind, nonce_id: &str, ) -> Result<(), SessionError>
pub fn subscriptions(&self) -> &SubscriptionRegistry
pub fn terminal(&self) -> TerminalRegistry
pub fn register_pending_url_elicitation( &self, elicitation_id: impl Into<String>, related_task_id: Option<String>, )
pub fn register_required_url_elicitations( &self, elicitations: &[CreateElicitationOperation], related_task_id: Option<&str>, )
pub fn queue_late_event(&self, event: LateSessionEvent)
pub fn take_late_events(&self) -> Vec<LateSessionEvent>
pub fn queue_tool_server_event(&self, event: ToolServerEvent)
pub fn queue_elicitation_completion(&self, elicitation_id: &str)
pub fn subscribe_resource(&self, uri: impl Into<String>)
pub fn unsubscribe_resource(&self, uri: &str)
pub fn is_resource_subscribed(&self, uri: &str) -> bool
pub fn set_auth_context( &self, auth_context: SessionAuthContext, ) -> (bool, SessionAnchorSnapshot, Option<String>)
pub fn set_auth_context_persisted<E>( &self, auth_context: SessionAuthContext, persist: impl FnOnce(&SessionAnchorSnapshot, Option<&str>) -> Result<(), E>, ) -> Result<(), SessionPersistError<E>>
pub fn set_peer_capabilities(&self, peer_capabilities: PeerCapabilities)
pub fn replace_roots(&self, roots: Vec<RootDefinition>)
pub fn activate(&self) -> Result<(), SessionError>
pub fn begin_draining(&self) -> Result<(), SessionError>
pub fn close(&self) -> Result<(), SessionError>
pub fn close_persisted<E>( &self, persist: impl FnOnce(&SessionAnchorSnapshot, Option<&str>) -> Result<(), E>, ) -> Result<(), SessionPersistError<E>>
pub fn ensure_operation_allowed( &self, operation: OperationKind, ) -> Result<(), SessionError>
pub fn track_request( &self, context: &OperationContext, operation_kind: OperationKind, cancellable: bool, ) -> Result<SessionRequestStart, SessionError>
pub fn complete_request( &self, request_id: &RequestId, ) -> Result<InflightRequest, SessionError>
pub fn complete_request_with_terminal_state( &self, request_id: &RequestId, terminal_state: OperationTerminalState, ) -> Result<InflightRequest, SessionError>
pub fn discard_unpersisted_request_start(&self, request_id: &RequestId)
pub fn request_cancellation( &self, request_id: &RequestId, ) -> Result<(), SessionError>
pub fn validate_parent_request_lineage( &self, request_id: &RequestId, parent_request_id: &RequestId, ) -> Result<RequestLineageRecord, SessionError>
pub fn validate_context( &self, context: &OperationContext, ) -> Result<(), SessionError>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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