[][src]Struct mio_named_pipes::NamedPipe

pub struct NamedPipe { /* fields omitted */ }

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]

impl Debug for NamedPipe[src]

impl Drop for NamedPipe[src]

impl Evented for NamedPipe[src]

impl FromRawHandle for NamedPipe[src]

impl Read for NamedPipe[src]

impl<'a> Read for &'a NamedPipe[src]

impl Write for NamedPipe[src]

impl<'a> Write for &'a NamedPipe[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.