pub fn ip6_new_from_bytes<T: ot::Boxable<OtType = otInstance>, D: AsRef<[u8]>>(
        instance: &'a T,
        data: D,
        settings: Option<&Settings>,
    ) -> Result<ot::Box<Message<'a>>, ot::MalformedOrNoBufs> {
        let data = data.as_ref();
        unsafe {
            // SAFETY: This is safe because we own the `otMessage*` resulting from
            //         `otIp6NewMessageFromBuffer`. Safety is also dependent on the correctness
            //         of the implementation of `otIp6NewMessageFromBuffer`.
            ot::Box::from_ot_ptr(otIp6NewMessageFromBuffer(
                instance.as_ot_ptr(),
                data.as_ptr(),
                data.len().try_into().expect("ot::Message::ip6_new_from_bytes: Buffer too large"),
                settings.map(|x| x.as_ref().as_ot_ptr()).unwrap_or(null()),
            ))
        }
        .ok_or(ot::MalformedOrNoBufs)
    }
/// Functional equivalent of
/// [`otsys::otIp6NewMessageFromBuffer`](crate::otsys::otIp6NewMessageFromBuffer).
///
/// Note that, due to limitation in how the underlying method can report errors,
/// it is impossible to differentiate the "NoBufs" error condition from the "IPv6 header
/// malformed" error condition, hence the unusual error type.


Note that, due to limitation in how the underlying method can report errors,
it is impossible to differentiate the "NoBufs" error condition from the "IPv6 header
malformed" error condition, hence the unusual error type.
Note that due to limitation in how the underlying method can report errors it is impossible to differentiate the " NoBufs " error condition from the " IPv6 header malformed " error condition hence the unusual error type .
pub fn ip6_new_from_bytes<T: ot::Boxable<OtType = otInstance>, D: AsRef<[u8]>>(
        instance: &'a T,
        data: D,
        settings: Option<&Settings>,
    ) -> Result<ot::Box<Message<'a>>, ot::MalformedOrNoBufs> {
        let data = data.as_ref();
        unsafe {
            // SAFETY: This is safe because we own the `otMessage*` resulting from
            //         `otIp6NewMessageFromBuffer`. Safety is also dependent on the correctness
            //         of the implementation of `otIp6NewMessageFromBuffer`.
            ot::Box::from_ot_ptr(otIp6NewMessageFromBuffer(
                instance.as_ot_ptr(),
                data.as_ptr(),
                data.len().try_into().expect("ot::Message::ip6_new_from_bytes: Buffer too large"),
                settings.map(|x| x.as_ref().as_ot_ptr()).unwrap_or(null()),
            ))
        }
        .ok_or(ot::MalformedOrNoBufs)
    }
pub fn ip6_new_from_bytes < T : ot :: Boxable < OtType = otInstance > , D : AsRef < [ u8 ] > > ( instance : & ' a T , data : D , settings : Option < & Settings > , ) -> Result < ot :: Box < Message < ' a > > , ot :: MalformedOrNoBufs > { let data = data . as_ref ( ) ; unsafe { // SAFETY: This is safe because we own the `otMessage*` resulting from //         `otIp6NewMessageFromBuffer`. Safety is also dependent on the correctness //         of the implementation of `otIp6NewMessageFromBuffer`. ot :: Box :: from_ot_ptr ( otIp6NewMessageFromBuffer ( instance . as_ot_ptr ( ) , data . as_ptr ( ) , data . len ( ) . try_into ( ) . expect ( " " ) , settings . map ( | x | x . as_ref ( ) . as_ot_ptr ( ) ) . unwrap_or ( null ( ) ) , ) ) } . ok_or ( ot :: MalformedOrNoBufs ) }
Functional equivalent of
[`otsys::otIp6NewMessageFromBuffer`](crate::otsys::otIp6NewMessageFromBuffer).
Functional equivalent of [ ` otsys :: otIp6NewMessageFromBuffer ` ] ( crate :: otsys :: otIp6NewMessageFromBuffer ) .
instance
&'a T
data
D
settings
Option<&Settings>
instance
&'a T
data
D
settings
Option<&Settings>