pub struct FileChannel { /* private fields */ }
Expand description
FileChannel is a handle for one end of a bidirectional channel.
Implementations§
Source§impl FileChannel
impl FileChannel
Sourcepub const fn new(
read_handle: FileDescriptor,
write_handle: FileDescriptor,
) -> Self
pub const fn new( read_handle: FileDescriptor, write_handle: FileDescriptor, ) -> Self
Create a new FileChannel from two file descriptors.
Sourcepub const fn read_handle(&self) -> FileDescriptor
pub const fn read_handle(&self) -> FileDescriptor
Returns the a copy of the FileDescriptor used for the read end of the channel.
Sourcepub const fn write_handle(&self) -> FileDescriptor
pub const fn write_handle(&self) -> FileDescriptor
Returns the a copy of the FileDescriptor used for the write end of the channel.
Trait Implementations§
Source§impl Channel for FileChannel
impl Channel for FileChannel
Source§fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 mut [u8],
) -> Pin<Box<dyn Future<Output = ChannelResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 mut [u8],
) -> Pin<Box<dyn Future<Output = ChannelResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Asynchronously read data from the channel into the provided buffer. Read more
Source§fn read_exact<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 mut [u8],
) -> Pin<Box<dyn Future<Output = ChannelResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn read_exact<'life0, 'life1, 'async_trait>(
&'life0 self,
buf: &'life1 mut [u8],
) -> Pin<Box<dyn Future<Output = ChannelResult<usize>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl Clone for FileChannel
impl Clone for FileChannel
Source§fn clone(&self) -> FileChannel
fn clone(&self) -> FileChannel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FileChannel
impl Debug for FileChannel
impl Copy for FileChannel
Auto Trait Implementations§
impl Freeze for FileChannel
impl RefUnwindSafe for FileChannel
impl Send for FileChannel
impl Sync for FileChannel
impl Unpin for FileChannel
impl UnwindSafe for FileChannel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more