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>
Sourcepub fn read<'a, 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<'_, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>,
buf: &'a mut [u8],
) -> impl Future<Output = Result<usize>>
pub fn read<'a, 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<'_, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>, buf: &'a mut [u8], ) -> impl Future<Output = Result<usize>>
Sourcepub fn write<'a, 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<'_, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>,
buf: &'a [u8],
) -> impl Future<Output = Result<usize>>
pub fn write<'a, 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<'_, S, TASKS, TASK_SIZE, ROOT_TASK_SIZE, TIMERS, FDS>, buf: &'a [u8], ) -> impl Future<Output = Result<usize>>
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.
§Errors
Returns an error if a syscall fails.
Sourcepub fn local_addr(&self) -> Result<SocketAddrUnix>
pub fn local_addr(&self) -> Result<SocketAddrUnix>
Sourcepub fn peer_addr(&self) -> Result<SocketAddrUnix>
pub fn peer_addr(&self) -> Result<SocketAddrUnix>
Sourcepub const fn split(&mut self) -> (BorrowedReadHalf<'_>, BorrowedWriteHalf<'_>)
pub const 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 Move 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