pub struct DefaultSession { /* private fields */ }Trait Implementations§
Source§impl Drop for DefaultSession
impl Drop for DefaultSession
Source§impl Session for DefaultSession
impl Session for DefaultSession
fn id(&self) -> &SessionId
Source§fn provider_info(&self) -> ProviderInfo
fn provider_info(&self) -> ProviderInfo
Provider metadata used by the current session.
Source§fn current_model(&self) -> String
fn current_model(&self) -> String
The model ID used by the current session.
Source§fn list_models(&self) -> BoxFuture<'_, Result<Vec<ModelInfo>, ProviderError>>
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>>
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>>
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>
fn current_mode(&self) -> Option<String>
The current active permission mode ID. Returns
None if no mode catalog is
loaded. Read moreSource§fn available_modes(&self) -> Vec<ModeDescriptor>
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>
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 moreSource§fn current_reasoning_effort(&self) -> Option<ReasoningEffort>
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>)
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
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>
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>>
fn run_turn( &self, prompt: Vec<ContentBlock>, ) -> BoxFuture<'_, Result<StopReason, TurnError>>
Starts a turn. Read more
Source§fn cancel_turn(&self)
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)
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§
impl !Freeze for DefaultSession
impl !RefUnwindSafe for DefaultSession
impl !UnwindSafe for DefaultSession
impl Send for DefaultSession
impl Sync for DefaultSession
impl Unpin for DefaultSession
impl UnsafeUnpin for DefaultSession
Blanket Implementations§
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