[−][src]Struct libuv::handles::streams::pipe::PipeHandle
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]
&mut self,
name: &str,
cb: CB
) -> Result<ConnectReq, Box<dyn Error>>
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]
fn clone(&self) -> PipeHandle
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for PipeHandle
[src]
impl From<PipeHandle> for StreamHandle
[src]
fn from(pipe: PipeHandle) -> StreamHandle
[src]
impl From<PipeHandle> for Handle
[src]
fn from(pipe: PipeHandle) -> Handle
[src]
impl HandleTrait for PipeHandle
[src]
fn is_active(&self) -> bool
[src]
fn is_closing(&self) -> bool
[src]
fn close<CB: Into<CloseCB<'static>>>(&mut self, cb: CB)
[src]
fn ref(&mut self)
[src]
fn unref(&mut self)
[src]
fn has_ref(&self) -> bool
[src]
fn send_buffer_size(&mut self, value: i32) -> Result<i32>
[src]
fn recv_buffer_size(&mut self, value: i32) -> Result<i32>
[src]
fn get_fileno(&self) -> Result<OsFile>
[src]
fn get_loop(&self) -> Loop
[src]
fn get_type(&self) -> HandleType
[src]
impl StreamTrait for PipeHandle
[src]
fn shutdown<CB: Into<ShutdownCB<'static>>>(
&mut self,
cb: CB
) -> Result<ShutdownReq>
[src]
&mut self,
cb: CB
) -> Result<ShutdownReq>
fn listen<CB: Into<ConnectionCB<'static>>>(
&mut self,
backlog: i32,
cb: CB
) -> Result<()>
[src]
&mut self,
backlog: i32,
cb: CB
) -> Result<()>
fn accept(&mut self, client: &mut StreamHandle) -> Result<()>
[src]
fn read_start<ACB: Into<AllocCB<'static>>, RCB: Into<ReadCB<'static>>>(
&mut self,
alloc_cb: ACB,
read_cb: RCB
) -> Result<()>
[src]
&mut self,
alloc_cb: ACB,
read_cb: RCB
) -> Result<()>
fn read_stop(&mut self) -> Result<()>
[src]
fn write<CB: Into<WriteCB<'static>>>(
&mut self,
bufs: &[impl BufTrait],
cb: CB
) -> Result<WriteReq>
[src]
&mut self,
bufs: &[impl BufTrait],
cb: CB
) -> Result<WriteReq>
fn write2<CB: Into<WriteCB<'static>>>(
&mut self,
send_handle: &StreamHandle,
bufs: &[impl BufTrait],
cb: CB
) -> Result<WriteReq>
[src]
&mut self,
send_handle: &StreamHandle,
bufs: &[impl BufTrait],
cb: CB
) -> Result<WriteReq>
fn try_write(&mut self, bufs: &[impl BufTrait]) -> Result<i32>
[src]
fn is_readable(&self) -> bool
[src]
fn is_writable(&self) -> bool
[src]
fn set_blocking(&mut self, blocking: bool) -> Result<()>
[src]
fn get_write_queue_size(&self) -> usize
[src]
impl ToHandle for PipeHandle
[src]
impl ToStream for PipeHandle
[src]
fn to_stream(&self) -> StreamHandle
[src]
impl TryFrom<Handle> for PipeHandle
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(handle: Handle) -> Result<Self, Self::Error>
[src]
impl TryFrom<StreamHandle> for PipeHandle
[src]
type Error = ConversionError
The type returned in the event of a conversion error.
fn try_from(stream: StreamHandle) -> Result<Self, Self::Error>
[src]
Auto Trait Implementations
impl RefUnwindSafe for PipeHandle
impl !Send for PipeHandle
impl !Sync for PipeHandle
impl Unpin for PipeHandle
impl UnwindSafe for PipeHandle
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,