pub struct PtyAttachment {
pub initial_backlog: Vec<u8>,
pub bytes_missed: u64,
/* private fields */
}Expand description
Active attachment to a daemon-owned PTY session.
Owns the socket; the connection is in streaming mode and cannot be used for unrelated RPCs.
Fields§
§initial_backlog: Vec<u8>Bytes received in the initial AttachPtySessionResponse (output the client missed before attach succeeded).
bytes_missed: u64Cumulative bytes dropped from the daemon’s ring buffer before this attach. Zero if the buffer never overflowed.
Implementations§
Source§impl PtyAttachment
impl PtyAttachment
Sourcepub fn attach(
scope_hash: Option<&str>,
session_id: &str,
rows: u16,
cols: u16,
steal: bool,
) -> Result<Self, AttachError>
pub fn attach( scope_hash: Option<&str>, session_id: &str, rows: u16, cols: u16, steal: bool, ) -> Result<Self, AttachError>
Open a fresh socket to the daemon and attach to session_id.
Sourcepub fn attach_to(
socket_path: &str,
session_id: &str,
rows: u16,
cols: u16,
steal: bool,
) -> Result<Self, AttachError>
pub fn attach_to( socket_path: &str, session_id: &str, rows: u16, cols: u16, steal: bool, ) -> Result<Self, AttachError>
Open a fresh socket at socket_path and attach to session_id.
Sourcepub fn recv_frame(&mut self) -> Result<PtyStreamFrame, AttachError>
pub fn recv_frame(&mut self) -> Result<PtyStreamFrame, AttachError>
Block until the next stream frame arrives.
Sourcepub fn recv_frame_with_timeout(
&mut self,
timeout: Duration,
) -> Result<Option<PtyStreamFrame>, AttachError>
pub fn recv_frame_with_timeout( &mut self, timeout: Duration, ) -> Result<Option<PtyStreamFrame>, AttachError>
Block until the next stream frame arrives, or until timeout
elapses (returns Ok(None)). The underlying socket is put into
nonblocking mode for the duration of the wait; callers should not
interleave this with recv_frame.
Sourcepub fn send_input(&mut self, bytes: &[u8]) -> Result<(), AttachError>
pub fn send_input(&mut self, bytes: &[u8]) -> Result<(), AttachError>
Send raw input bytes to the PTY.
Sourcepub fn send_interrupt(&mut self) -> Result<(), AttachError>
pub fn send_interrupt(&mut self) -> Result<(), AttachError>
Send an interrupt (Ctrl+C / SIGINT) to the child process group.
Sourcepub fn detach(self) -> Result<(), AttachError>
pub fn detach(self) -> Result<(), AttachError>
Cleanly detach this attachment; the session keeps running.