pub unsafe fn tibrv_try_decode_opaque<T: Copy>(
    msg: &MsgField,
) -> Result<&[T], TibrvError> {
    if msg.inner.type_ != TIBRVMSG_OPAQUE as u8 {
        Err(ErrorKind::FieldTypeError)?
    } else {
        assert!(!msg.inner.data.buf.is_null());
        // `size` in from_raw_parts is helpfully in 'elements' not bytes...
        let elements: usize = msg.inner.size as usize / std::mem::size_of::<T>();
        Ok(std::slice::from_raw_parts(
            msg.inner.data.buf as *const T,
            elements,
        ))
    }
}
/// Try and decode an opaque byte sequence into a slice
///
/// When using Rendezvous opaque byte sequences, all type information
/// is lost (internally the slice is passed as `void*`).
/// Therefore this function is approximately as unsafe as `std::mem::transmute`,
/// except without the soft and fluffy blanket of size checking.
Try and decode an opaque byte sequence into a slice
When using Rendezvous opaque byte sequences, all type information
is lost (internally the slice is passed as `void*`).
Therefore this function is approximately as unsafe as `std::mem::transmute`,
except without the soft and fluffy blanket of size checking.
Try and decode an opaque byte sequence into a slice When using Rendezvous opaque byte sequences all type information is lost ( internally the slice is passed as ` void * ` ) . Therefore this function is approximately as unsafe as ` std :: mem :: transmute ` except without the soft and fluffy blanket of size checking .
pub unsafe fn tibrv_try_decode_opaque<T: Copy>(
    msg: &MsgField,
) -> Result<&[T], TibrvError> {
    if msg.inner.type_ != TIBRVMSG_OPAQUE as u8 {
        Err(ErrorKind::FieldTypeError)?
    } else {
        assert!(!msg.inner.data.buf.is_null());
        // `size` in from_raw_parts is helpfully in 'elements' not bytes...
        let elements: usize = msg.inner.size as usize / std::mem::size_of::<T>();
        Ok(std::slice::from_raw_parts(
            msg.inner.data.buf as *const T,
            elements,
        ))
    }
}
pub unsafe fn tibrv_try_decode_opaque < T : Copy > ( msg : & MsgField , ) -> Result < & [ T ] , TibrvError > { if msg . inner . type_ != TIBRVMSG_OPAQUE as u8 { Err ( ErrorKind :: FieldTypeError ) ? } else { assert ! ( msg inner data buf is_null ( ) ) ; // `size` in from_raw_parts is helpfully in 'elements' not bytes... let elements : usize = msg . inner . size as usize / std :: mem :: size_of :: < T > ( ) ; Ok ( std :: slice :: from_raw_parts ( msg . inner . data . buf as * const T , elements , ) ) } }
Try and decode an opaque byte sequence into a slice
When using Rendezvous opaque byte sequences, all type information
is lost (internally the slice is passed as `void*`).
Try and decode an opaque byte sequence into a slice When using Rendezvous opaque byte sequences all type information is lost ( internally the slice is passed as ` void * ` ) .
msg
&MsgField
msg
&MsgField