[−][src]Struct mio_named_pipes::NamedPipe
Representation of a named pipe on Windows.
This structure internally contains a HANDLE
which represents the named
pipe, and also maintains state associated with the mio event loop and active
I/O operations that have been scheduled to translate IOCP to a readiness
model.
Implementations
impl NamedPipe
[src]
pub fn new<A: AsRef<OsStr>>(addr: A) -> Result<NamedPipe>
[src]
Creates a new named pipe at the specified addr
given a "reasonable
set" of initial configuration options.
Currently the configuration options are the same as miow. To change
these options, you can create a custom named pipe yourself and then use
the FromRawHandle
constructor to convert that type to an instance of a
NamedPipe
in this crate.
pub fn connect(&self) -> Result<()>
[src]
Attempts to call ConnectNamedPipe
, if possible.
This function will attempt to connect this pipe to a client in an
asynchronous fashion. If the function immediately establishes a
connection to a client then Ok(())
is returned. Otherwise if a
connection attempt was issued and is now in progress then a "would
block" error is returned.
When the connection is finished then this object will be flagged as being ready for a write, or otherwise in the writable state.
Errors
This function will return a "would block" error if the pipe has not yet been registered with an event loop, if the connection operation has previously been issued but has not yet completed, or if the connect itself was issued and didn't finish immediately.
Normal I/O errors from the call to ConnectNamedPipe
are returned
immediately.
pub fn take_error(&self) -> Result<Option<Error>>
[src]
Takes any internal error that has happened after the last I/O operation which hasn't been retrieved yet.
This is particularly useful when detecting failed attempts to connect
.
After a completed connect
flags this pipe as writable then callers
must invoke this method to determine whether the connection actually
succeeded. If this function returns None
then a client is connected,
otherwise it returns an error of what happened and a client shouldn't be
connected.
pub fn disconnect(&self) -> Result<()>
[src]
Disconnects this named pipe from a connected client.
This function will disconnect the pipe from a connected client, if any,
transitively calling the DisconnectNamedPipe
function. If the
disconnection is successful then this object will no longer be readable
or writable.
After a disconnect
is issued, then a connect
may be called again to
connect to another client.
Trait Implementations
impl AsRawHandle for NamedPipe
[src]
fn as_raw_handle(&self) -> RawHandle
[src]
impl Debug for NamedPipe
[src]
impl Drop for NamedPipe
[src]
impl Evented for NamedPipe
[src]
fn register(
&self,
poll: &Poll,
token: Token,
interest: Ready,
opts: PollOpt
) -> Result<()>
[src]
&self,
poll: &Poll,
token: Token,
interest: Ready,
opts: PollOpt
) -> Result<()>
fn reregister(
&self,
poll: &Poll,
token: Token,
interest: Ready,
opts: PollOpt
) -> Result<()>
[src]
&self,
poll: &Poll,
token: Token,
interest: Ready,
opts: PollOpt
) -> Result<()>
fn deregister(&self, poll: &Poll) -> Result<()>
[src]
impl FromRawHandle for NamedPipe
[src]
unsafe fn from_raw_handle(handle: RawHandle) -> NamedPipe
[src]
impl Read for NamedPipe
[src]
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut]) -> Result<usize, Error>
1.36.0[src]
fn is_read_vectored(&self) -> bool
[src]
unsafe fn initializer(&self) -> Initializer
[src]
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
1.0.0[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
fn bytes(self) -> Bytes<Self>
1.0.0[src]
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: Read,
1.0.0[src]
R: Read,
fn take(self, limit: u64) -> Take<Self>
1.0.0[src]
impl<'a> Read for &'a NamedPipe
[src]
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut]) -> Result<usize, Error>
1.36.0[src]
fn is_read_vectored(&self) -> bool
[src]
unsafe fn initializer(&self) -> Initializer
[src]
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize, Error>
1.0.0[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
fn bytes(self) -> Bytes<Self>
1.0.0[src]
fn chain<R>(self, next: R) -> Chain<Self, R> where
R: Read,
1.0.0[src]
R: Read,
fn take(self, limit: u64) -> Take<Self>
1.0.0[src]
impl Write for NamedPipe
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn flush(&mut self) -> Result<()>
[src]
fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize, Error>
1.36.0[src]
fn is_write_vectored(&self) -> bool
[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
fn write_all_vectored(&mut self, bufs: &mut [IoSlice]) -> Result<(), Error>
[src]
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
impl<'a> Write for &'a NamedPipe
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn flush(&mut self) -> Result<()>
[src]
fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize, Error>
1.36.0[src]
fn is_write_vectored(&self) -> bool
[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
fn write_all_vectored(&mut self, bufs: &mut [IoSlice]) -> Result<(), Error>
[src]
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
Auto Trait Implementations
impl !RefUnwindSafe for NamedPipe
impl Send for NamedPipe
impl Sync for NamedPipe
impl Unpin for NamedPipe
impl !UnwindSafe for NamedPipe
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,