pub struct UnixStream { /* private fields */ }Expand description
A Unix stream.
Implementations§
Source§impl UnixStream
impl UnixStream
Sourcepub async fn connect<S: State, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize>(
ctx: &Context<'_, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>,
addr: &SocketAddrUnix,
) -> Result<Self>
pub async fn connect<S: State, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize>( ctx: &Context<'_, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>, addr: &SocketAddrUnix, ) -> Result<Self>
Connects to a given address.
Sourcepub fn read<'a, 'ctx, S: State, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize>(
&'a mut self,
ctx: &'a Context<'ctx, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>,
buf: &'a mut [u8],
) -> impl Future<Output = Result<usize>>
pub fn read<'a, 'ctx, S: State, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize>( &'a mut self, ctx: &'a Context<'ctx, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>, buf: &'a mut [u8], ) -> impl Future<Output = Result<usize>>
Reads from the underlying socket into a given buffer.
Sourcepub fn write<'a, 'ctx, S: State, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize>(
&'a mut self,
ctx: &'a Context<'ctx, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>,
buf: &'a [u8],
) -> impl Future<Output = Result<usize>>
pub fn write<'a, 'ctx, S: State, const TASKS: usize, const TASK_SIZE: usize, const ROOT_TASK_SIZE: usize, const TIMERS: usize, const FDS: usize>( &'a mut self, ctx: &'a Context<'ctx, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>, buf: &'a [u8], ) -> impl Future<Output = Result<usize>>
Writes from a given buffer into the underlying socket.
Sourcepub fn shutdown(&self, how: Shutdown) -> Result<()>
pub fn shutdown(&self, how: Shutdown) -> Result<()>
Shuts down the connection (which also impacts potentially existing read/write halves).
The underlying file descriptor stays open until this value is dropped.
Sourcepub fn local_addr(&self) -> Result<SocketAddrUnix>
pub fn local_addr(&self) -> Result<SocketAddrUnix>
Returns local address.
Sourcepub fn peer_addr(&self) -> Result<SocketAddrUnix>
pub fn peer_addr(&self) -> Result<SocketAddrUnix>
Returns peer address.
Sourcepub fn split(&mut self) -> (BorrowedReadHalf<'_>, BorrowedWriteHalf<'_>)
pub fn split(&mut self) -> (BorrowedReadHalf<'_>, BorrowedWriteHalf<'_>)
Splits the UnixStream into two halves: reader and writer.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for UnixStream
impl !RefUnwindSafe for UnixStream
impl !Sync for UnixStream
impl Forget for UnixStream
impl Send for UnixStream
impl Unpin for UnixStream
impl UnsafeUnpin for UnixStream
impl UnwindSafe for UnixStream
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