pub fn tibrv_encode_port(port: u16, name: Option<&str>, id: Option<u32>) -> MsgField {
    must_name!(name, id);
    let name_cstr = name.and_then(|s| Some(CString::new(s).unwrap()));
    let ptr = name_cstr.as_ref().map_or(std::ptr::null(), |s| s.as_ptr());
    MsgField {
        name: name_cstr,
        inner: tibrvMsgField {
            name: ptr,
            size: std::mem::size_of::<u16>() as tibrv_u32,
            count: 1 as tibrv_u32,
            data: tibrvLocalData {
                ipport16: port.to_be(),
            },
            id: id.unwrap_or(0) as tibrv_u16,
            type_: TIBRVMSG_IPPORT16 as tibrv_u8,
        },
    }
}
/// Encode a `u16` as an IP Port message field.
///
/// Rendezvous has special provisions for network data types,
/// IPv4 Addresses and IP Ports are encoded as special types using
/// Network Byte Ordering.
///
/// Since we already provide an Impl for 'normal' `u16` this function will
/// encode using the special byte ordering.
Encode a `u16` as an IP Port message field.
Rendezvous has special provisions for network data types,
IPv4 Addresses and IP Ports are encoded as special types using
Network Byte Ordering.

Since we already provide an Impl for 'normal' `u16` this function will
encode using the special byte ordering.
Encode a ` u16 ` as an IP Port message field . Rendezvous has special provisions for network data types IPv4 Addresses and IP Ports are encoded as special types using Network Byte Ordering . Since we already provide an Impl for ' normal ' ` u16 ` this function will encode using the special byte ordering .
pub fn tibrv_encode_port(port: u16, name: Option<&str>, id: Option<u32>) -> MsgField {
    must_name!(name, id);
    let name_cstr = name.and_then(|s| Some(CString::new(s).unwrap()));
    let ptr = name_cstr.as_ref().map_or(std::ptr::null(), |s| s.as_ptr());
    MsgField {
        name: name_cstr,
        inner: tibrvMsgField {
            name: ptr,
            size: std::mem::size_of::<u16>() as tibrv_u32,
            count: 1 as tibrv_u32,
            data: tibrvLocalData {
                ipport16: port.to_be(),
            },
            id: id.unwrap_or(0) as tibrv_u16,
            type_: TIBRVMSG_IPPORT16 as tibrv_u8,
        },
    }
}
pub fn tibrv_encode_port ( port : u16 , name : Option < & str > , id : Option < u32 > ) -> MsgField { must_name ! ( name id ) ; let name_cstr = name . and_then ( | s | Some ( CString :: new ( s ) . unwrap ( ) ) ) ; let ptr = name_cstr . as_ref ( ) . map_or ( std :: ptr :: null ( ) , | s | s . as_ptr ( ) ) ; MsgField { name : name_cstr , inner : tibrvMsgField { name : ptr , size : std :: mem :: size_of :: < u16 > ( ) as tibrv_u32 , count : 1 as tibrv_u32 , data : tibrvLocalData { ipport16 : port . to_be ( ) , } , id : id . unwrap_or ( 0 ) as tibrv_u16 , type_ : TIBRVMSG_IPPORT16 as tibrv_u8 , } , } }
Encode a `u16` as an IP Port message field.
Encode a ` u16 ` as an IP Port message field .
port
u16
name
Option<&str>
id
Option<u32>
port
u16
name
Option<&str>
id
Option<u32>