Skip to main content

DefaultSession

Struct DefaultSession 

Source
pub struct DefaultSession { /* private fields */ }

Trait Implementations§

Source§

impl Drop for DefaultSession

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Session for DefaultSession

Source§

fn id(&self) -> &SessionId

Source§

fn provider_info(&self) -> ProviderInfo

Provider metadata used by the current session.
Source§

fn current_model(&self) -> String

The model ID used by the current session.
Source§

fn list_models(&self) -> BoxFuture<'_, Result<Vec<ModelInfo>, ProviderError>>

List the model candidates available from the current provider for this session. Read more
Source§

fn list_candidates( &self, ) -> BoxFuture<'_, Result<Vec<ModelCandidate>, ProviderError>>

List the (provider, model) candidate pairs visible to the session. Under a multi-provider setup, the same session may switch models across providers, so ACP rendering needs to annotate each candidate with its provider. Read more
Source§

fn set_model( &self, selection: ModelSelection, ) -> BoxFuture<'_, Result<(), ProviderError>>

Switches the model for the current session. Read more
Source§

fn current_mode(&self) -> Option<String>

The current active permission mode ID. Returns None if no mode catalog is loaded. Read more
Source§

fn available_modes(&self) -> Vec<ModeDescriptor>

The list of permission modes available to this session, in assembly order. Returns an empty list when no mode directory is mounted. Maps to ACP SessionModeState::available_modes.
Source§

fn set_mode(&self, mode_id: String) -> Result<(), AgentError>

Switch the current permission mode. The change takes effect on subsequent turns; the in-flight turn retains its original policy (same semantics as Self::set_model — the policy is snapshotted when run_turn starts). Read more
Source§

fn current_reasoning_effort(&self) -> Option<ReasoningEffort>

The current reasoning_effort level (None = unset, falling back to the provider default). Maps to the current value of the ACP thought-level configuration item.
Source§

fn set_reasoning_effort(&self, effort: Option<ReasoningEffort>)

Sets the reasoning_effort level. None clears the override (falls back to the provider default). Takes effect on subsequent turns. Providers that do not support this concept ignore it when assembling requests.
Source§

fn subscribe(&self) -> EventStream

Subscribe to the event stream. Three independent consumers (acp / storage / tracing) each call this once without interfering with each other — internally uses mpsc with fan-out so that slow consumers only experience backpressure without dropping events.
Source§

fn history_snapshot(&self) -> Vec<Message>

A read-only snapshot of the current history, used to replay the transcript to the client after a session load.
Source§

fn run_turn( &self, prompt: Vec<ContentBlock>, ) -> BoxFuture<'_, Result<StopReason, TurnError>>

Starts a turn. Read more
Source§

fn cancel_turn(&self)

Cancels the current turn. Idempotent: no-op if no turn is in progress.
Source§

fn resolve_permission(&self, id: ToolCallId, outcome: PermissionResolution)

Writes back the client response to the ACP reverse request session/request_permission to the main loop.

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> 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> IntoMaybeUndefined<T> for T

Source§

impl<T> IntoOption<T> for T

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