[][src]Struct libuv::handles::streams::pipe::PipeHandle

pub struct PipeHandle { /* fields omitted */ }

Pipe handles provide an abstraction over streaming files on Unix (including local domain sockets, pipes, and FIFOs) and named pipes on Windows.

Implementations

impl PipeHandle[src]

pub fn new(r#loop: &Loop, ipc: bool) -> Result<PipeHandle>[src]

Create and initialize a pipe handle. The ipc argument is a boolean to indicate if this pipe will be used for handle passing between processes (which may change the bytes on the wire). Only a connected pipe that will be passing the handles should have this flag set, not the listening pipe that accept() is called on.

pub fn open(&mut self, file: File) -> Result<()>[src]

Open an existing file descriptor or HANDLE as a pipe. The file descriptor is set to non-blocking mode.

Note: The passed file descriptor or HANDLE is not checked for its type, but it’s required that it represents a valid pipe.

pub fn bind(&mut self, name: &str) -> Result<(), Box<dyn Error>>[src]

Bind the pipe to a file path (Unix) or a name (Windows).

Note: Paths on Unix get truncated to sizeof(sockaddr_un.sun_path) bytes, typically between 92 and 108 bytes.

pub fn connect<CB: Into<ConnectCB<'static>>>(
    &mut self,
    name: &str,
    cb: CB
) -> Result<ConnectReq, Box<dyn Error>>
[src]

Connect to the Unix domain socket or the named pipe.

Note: Paths on Unix get truncated to sizeof(sockaddr_un.sun_path) bytes, typically between 92 and 108 bytes.

pub fn getsockname(&self) -> Result<SocketAddr, Box<dyn Error>>[src]

Get the name of the Unix domain socket or the named pipe.

pub fn getpeername(&self) -> Result<SocketAddr, Box<dyn Error>>[src]

Get the name of the Unix domain socket or the named pipe to which the handle is connected.

pub fn pending_instances(&mut self, count: i32)[src]

Set the number of pending pipe instance handles when the pipe server is waiting for connections.

Note: This setting applies to Windows only.

pub fn pending_count(&self) -> i32[src]

pub fn pending_type(&self) -> HandleType[src]

Used to receive handles over IPC pipes.

First - call pending_count(), if it’s > 0 then initialize a handle of the given type, returned by pending_type() and call uv_accept(pipe, handle).

pub fn chmod(&mut self, flags: ChmodFlags) -> Result<()>[src]

Alters pipe permissions, allowing it to be accessed from processes run by different users. Makes the pipe writable or readable by all users. Mode can be WRITABLE, READABLE or WRITABLE | READABLE. This function is blocking.

pub fn ipc(&self) -> bool[src]

Whether this pipe is suitable for handle passing between processes. Only a connected pipe that will be passing the handles should have this flag set, not the listening pipe that accept() is called on

Trait Implementations

impl Clone for PipeHandle[src]

impl Copy for PipeHandle[src]

impl From<PipeHandle> for StreamHandle[src]

impl From<PipeHandle> for Handle[src]

impl HandleTrait for PipeHandle[src]

impl StreamTrait for PipeHandle[src]

impl ToHandle for PipeHandle[src]

impl ToStream for PipeHandle[src]

impl TryFrom<Handle> for PipeHandle[src]

type Error = ConversionError

The type returned in the event of a conversion error.

impl TryFrom<StreamHandle> for PipeHandle[src]

type Error = ConversionError

The type returned in the event of a conversion error.

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.