Skip to main content

WindowsControlChannelServer

Struct WindowsControlChannelServer 

pub struct WindowsControlChannelServer {
    pipe: NamedPipeServer,
    endpoint: OsString,
}
Expand description

Daemon-side control channel backed by a Windows named pipe server.

One instance owns one [NamedPipeServer] endpoint. accept waits for the matching client process to connect; send / recv then exchange already-framed bytes produced by cssh-rs-protocol.

Fields§

§pipe: NamedPipeServer§endpoint: OsString

Implementations§

Source§

impl WindowsControlChannelServer

Source

pub fn bind(endpoint: &OsStr) -> Result<WindowsControlChannelServer, Error>

Open a new named-pipe server endpoint at endpoint.

§Arguments
  • endpoint - Fully-qualified Windows named-pipe name (e.g. \\.\pipe\cssh-rs-named-pipe-for-ipc).
§Returns

Ready-to-accept server, or the underlying I/O error from [ServerOptions::create].

Source

pub fn endpoint(&self) -> &OsStr

Endpoint name the server is bound to.

§Returns

The named-pipe path supplied to Self::bind.

Source

pub async fn ready_to_read(&mut self) -> Result<bool, Error>

Test for pending readable bytes without blocking.

§Returns

Ok(true) when the pipe has bytes ready to read, Ok(false) otherwise, or the underlying I/O error.

Trait Implementations§

Source§

impl ControlChannelServer for WindowsControlChannelServer

Source§

type Error = Error

Error type returned by control-channel operations.
Source§

async fn accept( &mut self, ) -> Result<(), <WindowsControlChannelServer as ControlChannelServer>::Error>

Wait for the client process to connect. Read more
Source§

async fn send( &mut self, frame: &[u8], ) -> Result<(), <WindowsControlChannelServer as ControlChannelServer>::Error>

Send an already-framed control message to the connected client. Read more
Source§

async fn recv( &mut self, buf: &mut [u8], ) -> Result<usize, <WindowsControlChannelServer as ControlChannelServer>::Error>

Read up to buf.len() bytes from the connected client into buf. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.