pub struct StandaloneSession { /* private fields */ }Implementations§
Source§impl StandaloneSession
impl StandaloneSession
pub fn set_project_memory_target( &mut self, target: Option<ProjectMemorySyncTarget>, )
pub async fn connect(target: &RelaySessionTarget) -> Result<Self>
pub async fn connect_command( spec: &CommandSpec, session_id: &str, ) -> Result<Self>
Sourcepub fn protocol_version(&self) -> u32
pub fn protocol_version(&self) -> u32
Protocol negotiated with the worker behind this connection. Lifecycle operations use it to avoid sending a newly introduced command to an older worker that cannot decode it.
pub async fn sync(&mut self) -> Result<ManagedSessionSnapshot>
pub fn snapshot(&self) -> ManagedSessionSnapshot
Sourcepub async fn submit_accepted(
&mut self,
command_id: String,
command: RelayCommand,
) -> Result<u64>
pub async fn submit_accepted( &mut self, command_id: String, command: RelayCommand, ) -> Result<u64>
Hands one command to the relay and returns the ordinal it accepted it at, without catching the local projection up to it.
Callers that need the projection current call Self::sync after.
Keeping the two apart matters on the prompt path: the catch-up is the
expensive half, and a caller waiting to hear that the relay took the
command should not wait for it. It also stops a failed catch-up from
looking like a failed submission to a caller that would retry.
pub async fn submit( &mut self, command_id: String, command: RelayCommand, ) -> Result<u64>
pub async fn respond_elicitation( &mut self, elicitation_id: String, response: ElicitationResponse, ) -> Result<()>
pub async fn stop_background_task( &mut self, background_task_id: String, ) -> Result<()>
Sourcepub async fn install_prompt_context(&mut self, text: String) -> Result<()>
pub async fn install_prompt_context(&mut self, text: String) -> Result<()>
Persist relay-private context for the next real prompt. It never contributes an event to the canonical projection.
Sourcepub async fn sync_project_memory(&mut self) -> Result<()>
pub async fn sync_project_memory(&mut self) -> Result<()>
Reconcile this worker’s project-memory replica at an explicit durable boundary. Normal relay attachment and polling must never perform this filesystem work: a degraded target could otherwise turn reconnects into an unbounded queue of timed-out snapshot writes.
Auto Trait Implementations§
impl !RefUnwindSafe for StandaloneSession
impl !UnwindSafe for StandaloneSession
impl Freeze for StandaloneSession
impl Send for StandaloneSession
impl Sync for StandaloneSession
impl Unpin for StandaloneSession
impl UnsafeUnpin for StandaloneSession
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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