[−][src]Struct tokio_seqpacket::ancillary::SocketAncillary
A Unix socket Ancillary data struct.
Implementations
impl<'a> SocketAncillary<'a>
[src]
pub fn new(buffer: &'a mut [u8]) -> Self
[src]
Create an ancillary data with the given buffer.
Example
use tokio_seqpacket::ancillary::SocketAncillary; let mut ancillary_buffer = [0; 128]; let mut ancillary = SocketAncillary::new(&mut ancillary_buffer[..]);
pub fn capacity(&self) -> usize
[src]
Returns the capacity of the buffer.
pub fn len(&self) -> usize
[src]
Returns the number of used bytes.
pub fn is_empty(&self) -> bool
[src]
Is true
if the number of used bytes is zero.
pub fn messages(&self) -> Messages<'_>ⓘNotable traits for Messages<'a>
impl<'a> Iterator for Messages<'a> type Item = Result<AncillaryData<'a>, AncillaryError>;
[src]
Notable traits for Messages<'a>
impl<'a> Iterator for Messages<'a> type Item = Result<AncillaryData<'a>, AncillaryError>;
Returns the iterator of the control messages.
pub fn truncated(&self) -> bool
[src]
Is true
if during a recv operation the ancillary was truncated.
pub fn add_fds(&mut self, fds: &[RawFd]) -> bool
[src]
Add file descriptors to the ancillary data.
The function returns true
if there was enough space in the buffer.
If there was not enough space then no file descriptors was appended.
Technically, that means this operation adds a control message with the level SOL_SOCKET
and type SCM_RIGHTS
.
pub fn add_creds(&mut self, creds: &[SocketCred]) -> bool
[src]
Add credentials to the ancillary data.
The function returns true
if there was enough space in the buffer.
If there was not enough space then no credentials was appended.
Technically, that means this operation adds a control message with the level SOL_SOCKET
and type SCM_CREDENTIALS
or SCM_CREDS
.
pub fn clear(&mut self)
[src]
Clears the ancillary data, removing all values.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for SocketAncillary<'a>
[src]
impl<'a> Send for SocketAncillary<'a>
[src]
impl<'a> Sync for SocketAncillary<'a>
[src]
impl<'a> Unpin for SocketAncillary<'a>
[src]
impl<'a> !UnwindSafe for SocketAncillary<'a>
[src]
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,
pub 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, 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.
pub 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>,