pub struct UnixDatagram { /* private fields */ }Expand description
A Unix datagram socket.
Implementations§
Source§impl UnixDatagram
impl UnixDatagram
Sourcepub fn bind(addr: &SocketAddrUnix) -> Result<Self>
pub fn bind(addr: &SocketAddrUnix) -> Result<Self>
Binds on a given address.
Sourcepub fn send_to<'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],
addr: &'a SocketAddrUnix,
) -> impl Future<Output = Result<usize>>
pub fn send_to<'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], addr: &'a SocketAddrUnix, ) -> impl Future<Output = Result<usize>>
Sends a given buffer to a given address.
Sourcepub fn recv_from<'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, SocketAddrUnix)>>
pub fn recv_from<'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, SocketAddrUnix)>>
Receives a datagram from any sender into a given buffer, returns its size and the sender address.
Sourcepub fn connect(&self, addr: &SocketAddrUnix) -> Result<()>
pub fn connect(&self, addr: &SocketAddrUnix) -> Result<()>
Sourcepub fn send<'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 send<'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>>
Sends a given buffer to the connected peer, see connect.
Sourcepub fn recv<'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 recv<'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>>
Receives a datagram from the connected peer into a given buffer, see connect.
Sourcepub fn local_addr(&self) -> Result<SocketAddrUnix>
pub fn local_addr(&self) -> Result<SocketAddrUnix>
Returns local address.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for UnixDatagram
impl !RefUnwindSafe for UnixDatagram
impl !Sync for UnixDatagram
impl Forget for UnixDatagram
impl Send for UnixDatagram
impl Unpin for UnixDatagram
impl UnsafeUnpin for UnixDatagram
impl UnwindSafe for UnixDatagram
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