Struct miow::pipe::NamedPipe [] [src]

pub struct NamedPipe(_);

A named pipe that can accept connections.

Methods

impl NamedPipe
[src]

Creates a new initial named pipe.

This function is equivalent to:

use miow::pipe::NamedPipeBuilder;

NamedPipeBuilder::new(addr)
                 .first(true)
                 .inbound(true)
                 .outbound(true)
                 .out_buffer_size(65536)
                 .in_buffer_size(65536)
                 .create();

Waits until either a time-out interval elapses or an instance of the specified named pipe is available for connection.

If this function succeeds the process can create a File to connect to the named pipe.

Connects this named pipe to a client, blocking until one becomes available.

This function will call the ConnectNamedPipe function to await for a client to connect. This can be called immediately after the pipe is created, or after it has been disconnected from a previous client.

Issue a connection request with the specified overlapped operation.

This function will issue a request to connect a client to this server, returning immediately after starting the overlapped operation.

If this function immediately succeeds then Ok(true) is returned. If the overlapped operation is enqueued and pending, then Ok(false) is returned. Otherwise an error is returned indicating what went wrong.

Unsafety

This function is unsafe because the kernel requires that the overlapped pointer is valid until the end of the I/O operation. The kernel also requires that overlapped is unique for this I/O operation and is not in use for any other I/O.

To safely use this function callers must ensure that this pointer is valid until the I/O operation is completed, typically via completion ports and waiting to receive the completion notification on the port.

Disconnects this named pipe from any connected client.

Issues an overlapped read operation to occur on this pipe.

This function will issue an asynchronous read to occur in an overlapped fashion, returning immediately. The buf provided will be filled in with data and the request is tracked by the overlapped function provided.

If the operation succeeds immediately, Ok(true) is returned. If an asynchronous operation is enqueued, then Ok(false) is returned. Otherwise if an error occurred it is returned.

When this operation completes (or if it completes immediately), another mechanism must be used to learn how many bytes were transferred (such as looking at the filed in the IOCP status message).

Unsafety

This function is unsafe because the kernel requires that the buf and overlapped pointers to be valid until the end of the I/O operation. The kernel also requires that overlapped is unique for this I/O operation and is not in use for any other I/O.

To safely use this function callers must ensure that the pointers are valid until the I/O operation is completed, typically via completion ports and waiting to receive the completion notification on the port.

Issues an overlapped write operation to occur on this pipe.

This function will issue an asynchronous write to occur in an overlapped fashion, returning immediately. The buf provided will be filled in with data and the request is tracked by the overlapped function provided.

If the operation succeeds immediately, Ok(true) is returned. If an asynchronous operation is enqueued, then Ok(false) is returned. Otherwise if an error occurred it is returned.

When this operation completes (or if it completes immediately), another mechanism must be used to learn how many bytes were transferred (such as looking at the filed in the IOCP status message).

Unsafety

This function is unsafe because the kernel requires that the buf and overlapped pointers to be valid until the end of the I/O operation. The kernel also requires that overlapped is unique for this I/O operation and is not in use for any other I/O.

To safely use this function callers must ensure that the pointers are valid until the I/O operation is completed, typically via completion ports and waiting to receive the completion notification on the port.

Calls the GetOverlappedResult function to get the result of an overlapped operation for this handle.

This function takes the OVERLAPPED argument which must have been used to initiate an overlapped I/O operation, and returns either the successful number of bytes transferred during the operation or an error if one occurred.

Unsafety

This function is unsafe as overlapped must have previously been used to execute an operation for this handle, and it must also be a valid pointer to an Overlapped instance.

Panics

This function will panic

Trait Implementations

impl Debug for NamedPipe
[src]

Formats the value using the given formatter.

impl Read for NamedPipe
[src]

Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read the exact number of bytes required to fill buf. Read more

Creates a "by reference" adaptor for this instance of Read. Read more

Transforms this Read instance to an Iterator over its bytes. Read more

Unstable (io)

: the semantics of a partial read/write of where errors happen is currently unclear and may change

Transforms this Read instance to an Iterator over chars. Read more

Creates an adaptor which will chain this stream with another. Read more

Creates an adaptor which will read at most limit bytes from it. Read more

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

Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read the exact number of bytes required to fill buf. Read more

Creates a "by reference" adaptor for this instance of Read. Read more

Transforms this Read instance to an Iterator over its bytes. Read more

Unstable (io)

: the semantics of a partial read/write of where errors happen is currently unclear and may change

Transforms this Read instance to an Iterator over chars. Read more

Creates an adaptor which will chain this stream with another. Read more

Creates an adaptor which will read at most limit bytes from it. Read more

impl Write for NamedPipe
[src]

Write a buffer into this object, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this write. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a "by reference" adaptor for this instance of Write. Read more

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

Write a buffer into this object, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this write. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a "by reference" adaptor for this instance of Write. Read more

impl AsRawHandle for NamedPipe
[src]

Extracts the raw handle, without taking any ownership.

impl FromRawHandle for NamedPipe
[src]

Constructs a new I/O object from the specified raw handle. Read more

impl IntoRawHandle for NamedPipe
[src]

Consumes this object, returning the raw underlying handle. Read more