/// Try and decode an IP Port message field.
Try and decode an IP Port message field.
Try and decode an IP Port message field .
pub fn tibrv_try_decode_port(msg: &MsgField) -> Result<u16, TibrvError> {
    if msg.inner.count > 1 {
        Err(ErrorKind::NonVectorFieldError)?
    }
    if msg.inner.type_ == TIBRVMSG_IPPORT16 as u8 {
        let val = unsafe { msg.inner.data.ipport16 };
        let decoded = u16::from_be(val);
        Ok(decoded)
    } else {
        Err(ErrorKind::FieldTypeError)?
    }
}
pub fn tibrv_try_decode_port ( msg : & MsgField ) -> Result < u16 , TibrvError > { if msg . inner . count > 1 { Err ( ErrorKind :: NonVectorFieldError ) ? } if msg . inner . type_ == TIBRVMSG_IPPORT16 as u8 { let val = unsafe { msg . inner . data . ipport16 } ; let decoded = u16 :: from_be ( val ) ; Ok ( decoded ) } else { Err ( ErrorKind :: FieldTypeError ) ? } }
Try and decode an IP Port message field.
Try and decode an IP Port message field .
msg
&MsgField