Struct interprocess::os::windows::named_pipe::tokio::DuplexMsgPipeStream
source · pub struct DuplexMsgPipeStream { /* private fields */ }tokio_support only.Expand description
Implementations
sourceimpl DuplexMsgPipeStream
impl DuplexMsgPipeStream
sourcepub fn connect(name: impl AsRef<OsStr>) -> Result<Self>
pub fn connect(name: impl AsRef<OsStr>) -> Result<Self>
Tries to connect to the specified named pipe (the \\.\pipe\ prefix is added automatically).
If there is no available server, returns immediately with the WouldBlock error.
sourcepub fn connect_to_remote(
pipe_name: impl AsRef<OsStr>,
hostname: impl AsRef<OsStr>
) -> Result<Self>
pub fn connect_to_remote(
pipe_name: impl AsRef<OsStr>,
hostname: impl AsRef<OsStr>
) -> Result<Self>
Tries to connect to the specified named pipe at a remote computer (the \\<hostname>\pipe\ prefix is added automatically).
If there is no available server, returns immediately with the WouldBlock error.
sourcepub fn is_server(&self) -> bool
pub fn is_server(&self) -> bool
Returns true if the stream was created by a listener (server-side), false if it was created by connecting to a server (client-side).
sourcepub fn is_client(&self) -> bool
pub fn is_client(&self) -> bool
Returns true if the stream was created by connecting to a server (client-side), false if it was created by a listener (server-side).
sourcepub unsafe fn from_raw_handle(handle: *mut c_void) -> Result<Self>
pub unsafe fn from_raw_handle(handle: *mut c_void) -> Result<Self>
Creates a Tokio-based async object from a given raw handle. This will also attach the object to the Tokio runtime this function is called in, so calling it outside a runtime will result in an error (which is why the FromRawHandle trait can’t be implemented instead).
Safety
The given handle must be valid (i.e. refer to an existing kernel object) and must not be owned by any other handle container. If this is not upheld, an arbitrary handle will be closed when the returned object is dropped.
sourcepub fn split(self) -> (MsgReaderPipeStream, MsgWriterPipeStream)
pub fn split(self) -> (MsgReaderPipeStream, MsgWriterPipeStream)
Splits the duplex stream into its reading and writing half.
sourcepub fn client_process_id(&self) -> Result<u32>
pub fn client_process_id(&self) -> Result<u32>
Retrieves the process identifier of the client side of the named pipe connection.
sourcepub fn client_session_id(&self) -> Result<u32>
pub fn client_session_id(&self) -> Result<u32>
Retrieves the session identifier of the client side of the named pipe connection.
sourcepub fn server_process_id(&self) -> Result<u32>
pub fn server_process_id(&self) -> Result<u32>
Retrieves the process identifier of the server side of the named pipe connection.
sourcepub fn server_session_id(&self) -> Result<u32>
pub fn server_session_id(&self) -> Result<u32>
Retrieves the session identifier of the server side of the named pipe connection.
sourcepub fn disconnect_without_flushing(self) -> Result<()>
pub fn disconnect_without_flushing(self) -> Result<()>
Disconnects the named pipe stream without flushing buffers, causing all data in those buffers to be lost. This is much faster (and, in some case, the only finite-time way of ending things) than simply dropping the stream, since, for non-async named pipes, the Drop implementation flushes first.
Only makes sense for server-side pipes and will return an error if called on a client stream. For async pipe streams, this is the same as dropping the pipe.
Trait Implementations
sourceimpl AsyncRead for &DuplexMsgPipeStream
impl AsyncRead for &DuplexMsgPipeStream
sourceimpl AsyncRead for DuplexMsgPipeStream
impl AsyncRead for DuplexMsgPipeStream
sourceimpl AsyncWrite for &DuplexMsgPipeStream
impl AsyncWrite for &DuplexMsgPipeStream
sourcefn poll_write(
self: Pin<&mut Self>,
ctx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_write(
self: Pin<&mut Self>,
ctx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>
buf into the object. Read moresourcefn poll_flush(self: Pin<&mut Self>, ctx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, ctx: &mut Context<'_>) -> Poll<Result<()>>
sourceimpl AsyncWrite for DuplexMsgPipeStream
impl AsyncWrite for DuplexMsgPipeStream
sourcefn poll_write(
self: Pin<&mut Self>,
ctx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>
fn poll_write(
self: Pin<&mut Self>,
ctx: &mut Context<'_>,
buf: &[u8]
) -> Poll<Result<usize>>
buf into the object. Read moresourcefn poll_flush(self: Pin<&mut Self>, ctx: &mut Context<'_>) -> Poll<Result<()>>
fn poll_flush(self: Pin<&mut Self>, ctx: &mut Context<'_>) -> Poll<Result<()>>
sourceimpl Debug for DuplexMsgPipeStream
impl Debug for DuplexMsgPipeStream
sourceimpl Drop for DuplexMsgPipeStream
impl Drop for DuplexMsgPipeStream
sourceimpl TokioPipeStream for DuplexMsgPipeStream
impl TokioPipeStream for DuplexMsgPipeStream
sourceconst ROLE: PipeStreamRole = PipeStreamRole::ReaderAndWriter
const ROLE: PipeStreamRole = PipeStreamRole::ReaderAndWriter
PipeStreamRole enumeration for more on what this means.sourceconst WRITE_MODE: Option<PipeMode> = MsgWriterPipeStream::WRITE_MODE
const WRITE_MODE: Option<PipeMode> = MsgWriterPipeStream::WRITE_MODE
PipeMode::Bytes, message boundaries will broken and having READ_MODE at PipeMode::Messages would be a pipe creation error. Read moresourceconst READ_MODE: Option<PipeMode> = MsgReaderPipeStream::READ_MODE
const READ_MODE: Option<PipeMode> = MsgReaderPipeStream::READ_MODE
WRITE_MODE is PipeMode::Messages and READ_MODE is PipeMode::Bytes, the message boundaries will be destroyed when reading even though they are retained when written. See the PipeMode enumeration for more on what those modes mean. Read moreAuto Trait Implementations
impl RefUnwindSafe for DuplexMsgPipeStream
impl Send for DuplexMsgPipeStream
impl Sync for DuplexMsgPipeStream
impl Unpin for DuplexMsgPipeStream
impl UnwindSafe for DuplexMsgPipeStream
Blanket Implementations
impl<R> AsyncReadExt for Rwhere
R: AsyncRead + ?Sized,
impl<R> AsyncReadExt for Rwhere
R: AsyncRead + ?Sized,
fn read(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
fn read(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
fn read_vectored(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>]
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
fn read_to_end(
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
fn read_to_end(
&'a mut self,
buf: &'a mut Vec<u8, Global>
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
fn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
fn read_to_string(
&'a mut self,
buf: &'a mut String
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
fn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
fn read_exact(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
buf. Read morefn take(self, limit: u64) -> Take<Self>where
Self: Sized,
fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
limit bytes from it. Read moreimpl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
impl<W> AsyncWriteExt for Wwhere
W: AsyncWrite + ?Sized,
fn write(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self>where
Self: Unpin,
fn write(&'a mut self, buf: &'a [u8]) -> WriteFuture<'a, Self>where
Self: Unpin,
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectoredFuture<'a, Self>where
Self: Unpin,
fn write_vectored(
&'a mut self,
bufs: &'a [IoSlice<'a>]
) -> WriteVectoredFuture<'a, Self>where
Self: Unpin,
fn write_all(&'a mut self, buf: &'a [u8]) -> WriteAllFuture<'a, Self>where
Self: Unpin,
fn write_all(&'a mut self, buf: &'a [u8]) -> WriteAllFuture<'a, Self>where
Self: Unpin,
fn flush(&mut self) -> FlushFuture<'_, Self>where
Self: Unpin,
fn flush(&mut self) -> FlushFuture<'_, Self>where
Self: Unpin,
fn boxed_writer<'a>(self) -> Pin<Box<dyn AsyncWrite + Send + 'a, Global>>where
Self: 'a + Sized + Send,
fn boxed_writer<'a>(self) -> Pin<Box<dyn AsyncWrite + Send + 'a, Global>>where
Self: 'a + Sized + Send,
dyn AsyncWrite + Send + 'a. Read more