pub struct ServerState { /* private fields */ }Expand description
Shared handler state for one ACP stdio server process.
Implementations§
Source§impl ServerState
impl ServerState
Sourcepub fn new(config: ServerConfig) -> Self
pub fn new(config: ServerConfig) -> Self
Create process-local ACP server state.
Sourcepub fn create_session(&self, cwd: &Path) -> Result<String, String>
pub fn create_session(&self, cwd: &Path) -> Result<String, String>
Register a new ACP session and return its opaque session id.
Sourcepub fn client_can_run_terminal(&self) -> bool
pub fn client_can_run_terminal(&self) -> bool
Return whether the initialized ACP client can run terminal commands.
Sourcepub fn client_can_read_text_files(&self) -> bool
pub fn client_can_read_text_files(&self) -> bool
Return whether the initialized ACP client can serve editor-visible reads.
Sourcepub fn client_can_write_text_files(&self) -> bool
pub fn client_can_write_text_files(&self) -> bool
Return whether the initialized ACP client can perform editor-visible writes.
Sourcepub fn cancel_session(&self, session_id: &str)
pub fn cancel_session(&self, session_id: &str)
Mark a known session cancelled.
Sourcepub fn register_turn_cancel_token(&self, session_id: &str, token: CancelToken)
pub fn register_turn_cancel_token(&self, session_id: &str, token: CancelToken)
Associate a running turn’s cancel token with the session.
Sourcepub fn clear_turn_cancel_token(&self, session_id: &str)
pub fn clear_turn_cancel_token(&self, session_id: &str)
Drop any active-turn cancellation token for a finished turn.
Sourcepub fn has_session(&self, session_id: &str) -> bool
pub fn has_session(&self, session_id: &str) -> bool
Return whether a session exists.
Trait Implementations§
Source§impl Clone for ServerState
impl Clone for ServerState
Source§fn clone(&self) -> ServerState
fn clone(&self) -> ServerState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ServerState
impl RefUnwindSafe for ServerState
impl Send for ServerState
impl Sync for ServerState
impl Unpin for ServerState
impl UnsafeUnpin for ServerState
impl UnwindSafe for ServerState
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
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 moreSource§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.