pub enum AncillaryData {
Unix(UnixControlData),
Ip(ControlMessage),
}Expand description
AncillaryData converts a cmsghdr into a representation suitable for passing around
inside of starnix. In AF_UNIX/SCM_RIGHTS, for example, the file descrpitors will be turned
into FileHandles that can be sent to other tasks.
An AncillaryData instance can be converted back into a cmsghdr. At that point the contained
objects will be converted back to what can be stored in a cmsghdr. File handles, for example,
will be added to the reading task’s files and the associated file descriptors will be stored in
the cmsghdr.
Variants§
Unix(UnixControlData)
Ip(ControlMessage)
Implementations§
Source§impl AncillaryData
impl AncillaryData
Sourcepub fn from_cmsg(
current_task: &CurrentTask,
message: ControlMsg,
) -> Result<Self, Errno>
pub fn from_cmsg( current_task: &CurrentTask, message: ControlMsg, ) -> Result<Self, Errno>
Creates a new AncillaryData instance representing the data in message.
§Parameters
current_task: The current task. Used to interpret SCM_RIGHTS messages.message: The message header to parse.
pub fn into_controlmsg<L>(
self,
locked: &mut Locked<L>,
current_task: &CurrentTask,
flags: SocketMessageFlags,
) -> Result<Option<ControlMsg>, Errno>where
L: LockEqualOrBefore<FileOpsCore>,
Sourcepub fn total_size(&self, current_task: &CurrentTask) -> usize
pub fn total_size(&self, current_task: &CurrentTask) -> usize
Returns the total size of all data in this message.
Sourcepub fn minimum_size(&self) -> usize
pub fn minimum_size(&self) -> usize
Returns the minimum size that can fit some amount of this message’s data.
Sourcepub fn into_bytes<L>(
self,
locked: &mut Locked<L>,
current_task: &CurrentTask,
flags: SocketMessageFlags,
space_available: usize,
) -> Result<Vec<u8>, Errno>where
L: LockEqualOrBefore<FileOpsCore>,
pub fn into_bytes<L>(
self,
locked: &mut Locked<L>,
current_task: &CurrentTask,
flags: SocketMessageFlags,
space_available: usize,
) -> Result<Vec<u8>, Errno>where
L: LockEqualOrBefore<FileOpsCore>,
Convert the message into bytes, truncating it if it exceeds the available space.
Trait Implementations§
Source§impl Clone for AncillaryData
impl Clone for AncillaryData
Source§fn clone(&self) -> AncillaryData
fn clone(&self) -> AncillaryData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AncillaryData
impl !RefUnwindSafe for AncillaryData
impl Send for AncillaryData
impl Sync for AncillaryData
impl Unpin for AncillaryData
impl !UnwindSafe for AncillaryData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more