pub struct PtyClient { /* private fields */ }Expand description
Client for interactive PTY sessions in the guest over Unix socket.
Connects to the PTY server (vsock port 4090) and provides async
frame-based communication for bidirectional terminal I/O.
Uses a3s_transport::FrameReader/FrameWriter for wire I/O.
Implementations§
Source§impl PtyClient
impl PtyClient
Sourcepub async fn connect(socket_path: &Path) -> Result<Self>
pub async fn connect(socket_path: &Path) -> Result<Self>
Connect to the PTY server via Unix socket.
Sourcepub async fn send_request(&mut self, req: &PtyRequest) -> Result<()>
pub async fn send_request(&mut self, req: &PtyRequest) -> Result<()>
Send a PtyRequest to start an interactive session.
Sourcepub async fn start_stream(self, req: &PtyRequest) -> Result<StreamingPty>
pub async fn start_stream(self, req: &PtyRequest) -> Result<StreamingPty>
Start a streaming PTY session and return a handle for supervision.
Sourcepub async fn send_resize(&mut self, cols: u16, rows: u16) -> Result<()>
pub async fn send_resize(&mut self, cols: u16, rows: u16) -> Result<()>
Send a terminal resize notification.
Sourcepub async fn read_frame(&mut self) -> Result<Option<(u8, Vec<u8>)>>
pub async fn read_frame(&mut self) -> Result<Option<(u8, Vec<u8>)>>
Read the next frame from the guest.
Returns Ok(None) on EOF (guest disconnected).
Sourcepub fn into_split(
self,
) -> (FrameReader<ReadHalf<UnixStream>>, FrameWriter<WriteHalf<UnixStream>>)
pub fn into_split( self, ) -> (FrameReader<ReadHalf<UnixStream>>, FrameWriter<WriteHalf<UnixStream>>)
Split the client into read and write halves for concurrent I/O.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PtyClient
impl RefUnwindSafe for PtyClient
impl Send for PtyClient
impl Sync for PtyClient
impl Unpin for PtyClient
impl UnsafeUnpin for PtyClient
impl UnwindSafe for PtyClient
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> 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