/// Returns true iff the `size` is large enough to fit the message's header as well as all of
/// its data.
Returns true iff the `size` is large enough to fit the message's header as well as all of
its data.
Returns true iff the ` size ` is large enough to fit the message ' s header as well as all of its data .
pub fn can_fit_all_data(&self, size: usize) -> bool {
        let data_length = match self {
            UnixControlData::Rights(files) => files.len() * std::mem::size_of::<FdNumber>(),
            UnixControlData::Credentials(_credentials) => std::mem::size_of::<ucred>(),
            UnixControlData::Security(string) => string.len(),
        };
        data_length + cmsghdr::header_length() <= size
    }
pub fn can_fit_all_data ( & self , size : usize ) -> bool { let data_length = match self { UnixControlData :: Rights ( files ) => files . len ( ) * std :: mem :: size_of :: < FdNumber > ( ) , UnixControlData :: Credentials ( _credentials ) => std :: mem :: size_of :: < ucred > ( ) , UnixControlData :: Security ( string ) => string . len ( ) , } ; data_length + cmsghdr :: header_length ( ) <= size }
Returns true iff the `size` is large enough to fit the message's header as well as all of
its data.
Returns true iff the ` size ` is large enough to fit the message ' s header as well as all of its data .
&self
size
usize