pub struct PtyHandler { /* private fields */ }Expand description
Enhanced PTY handler that maintains state across connections
Implementations§
Source§impl PtyHandler
impl PtyHandler
pub fn new(master_fd: RawFd, buffer_size: usize) -> Self
Sourcepub fn read_pty_data(&mut self, buffer: &mut [u8]) -> Result<Option<Vec<u8>>>
pub fn read_pty_data(&mut self, buffer: &mut [u8]) -> Result<Option<Vec<u8>>>
Read from PTY and handle the data
Sourcepub fn write_to_pty(&mut self, data: &[u8]) -> Result<()>
pub fn write_to_pty(&mut self, data: &[u8]) -> Result<()>
Write data to PTY
Sourcepub fn process_pty_output(
&mut self,
data: &[u8],
client: &mut Option<UnixStream>,
) -> Result<()>
pub fn process_pty_output( &mut self, data: &[u8], client: &mut Option<UnixStream>, ) -> Result<()>
Process PTY data and distribute to client or buffer
Sourcepub fn send_buffered_data(&mut self, client: &mut UnixStream) -> Result<()>
pub fn send_buffered_data(&mut self, client: &mut UnixStream) -> Result<()>
Send buffered data to a newly connected client
Sourcepub fn refresh_terminal(&mut self) -> Result<()>
pub fn refresh_terminal(&mut self) -> Result<()>
Request terminal to refresh/redraw
Auto Trait Implementations§
impl Freeze for PtyHandler
impl RefUnwindSafe for PtyHandler
impl Send for PtyHandler
impl Sync for PtyHandler
impl Unpin for PtyHandler
impl UnwindSafe for PtyHandler
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> 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