pub struct NamedPipeServer { /* private fields */ }Expand description
A connected or connectable named pipe server instance.
Implementations§
Source§impl NamedPipeServer
impl NamedPipeServer
Sourcepub fn endpoint(&self) -> &PipeServerEndpoint
pub fn endpoint(&self) -> &PipeServerEndpoint
Return the underlying endpoint.
Sourcepub fn default_timeout(&self) -> Duration
pub fn default_timeout(&self) -> Duration
Return the configured default timeout.
Sourcepub fn allow_executable(&mut self, path: impl Into<PathBuf>)
pub fn allow_executable(&mut self, path: impl Into<PathBuf>)
Add an executable path to the allow-list.
The comparison is case-insensitive. If no paths are in the allow-list (the default), all processes are allowed to connect.
Sourcepub fn remove_executable(&mut self, path: impl Into<PathBuf>)
pub fn remove_executable(&mut self, path: impl Into<PathBuf>)
Remove an executable path from the allow-list.
The comparison is case-insensitive. Does nothing if the path is not present.
Sourcepub fn connect(&self) -> Result<()>
pub fn connect(&self) -> Result<()>
Block until a client connects to this instance.
If an executable allow-list was configured via NamedPipeServerBuilder::allow_executable,
the connecting process’s image path is checked against the list. If it does not match,
the connection is immediately disconnected and an Error::AccessDenied error is returned.
An empty allow-list (the default) permits all processes to connect.
Sourcepub fn connect_with_timeout(&self, timeout: Duration) -> Result<()>
pub fn connect_with_timeout(&self, timeout: Duration) -> Result<()>
Block until a client connects to this instance or the timeout elapses.
This method returns [Error::Pipe(PipeError::Timeout)] if no client connection is
completed within the provided timeout.
Sourcepub fn connect_with_wait(&self, wait: &Wait) -> Result<()>
pub fn connect_with_wait(&self, wait: &Wait) -> Result<()>
Block until a client connects or an external wait handle is signaled
If wait is signaled first, this method cancels the pending connect operation and
returns [Error::Pipe(PipeError::Connect)] with interruption context.
Sourcepub fn connect_with_wait_timeout(
&self,
wait: &Wait,
timeout: Duration,
) -> Result<()>
pub fn connect_with_wait_timeout( &self, wait: &Wait, timeout: Duration, ) -> Result<()>
Block until a client connects, an external wait handle is signaled, or timeout elapses.
If wait is signaled first, this method cancels the pending connect operation and
returns [Error::Pipe(PipeError::Connect)] with interruption context.
Sourcepub fn disconnect(&self) -> Result<()>
pub fn disconnect(&self) -> Result<()>
Disconnect the currently connected client.
Trait Implementations§
Source§impl Debug for NamedPipeServer
impl Debug for NamedPipeServer
Source§impl Read for NamedPipeServer
impl Read for NamedPipeServer
Source§fn read(&mut self, buf: &mut [u8]) -> Result<usize>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
1.36.0 · Source§fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
read, except that it reads into a slice of buffers. Read moreSource§fn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector)1.0.0 · Source§fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
buf. Read more1.0.0 · Source§fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
buf. Read more1.6.0 · Source§fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
buf. Read moreSource§fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
read_buf)Source§fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
read_buf)cursor. Read more1.0.0 · Source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Read. Read more1.0.0 · Source§fn chain<R>(self, next: R) -> Chain<Self, R>
fn chain<R>(self, next: R) -> Chain<Self, R>
Source§impl Write for NamedPipeServer
impl Write for NamedPipeServer
Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored)