pub struct HostID {
pub id: [u8; 16],
}
Expand description
A one_two_eight identifier.
Fields§
§id: [u8; 16]
The raw bytes for this identifier.
Implementations§
Source§impl HostID
impl HostID
Sourcepub fn from_human_readable(s: &str) -> Option<Self>
pub fn from_human_readable(s: &str) -> Option<Self>
Construct an identifier from its human-readable form.
Sourcepub fn human_readable(&self) -> String
pub fn human_readable(&self) -> String
Construct a string corresponding to the human-readable form of this identifier.
Sourcepub fn prefix_free_readable(&self) -> String
pub fn prefix_free_readable(&self) -> String
Return the prefix-free encoding of this identifier.
Trait Implementations§
Source§impl<'a> FieldPackHelper<'a, message<HostID>> for HostID
impl<'a> FieldPackHelper<'a, message<HostID>> for HostID
Source§fn field_pack_sz(&self, tag: &Tag) -> usize
fn field_pack_sz(&self, tag: &Tag) -> usize
The size of encoding self with tag.
Source§fn field_pack(&self, tag: &Tag, out: &mut [u8])
fn field_pack(&self, tag: &Tag, out: &mut [u8])
Pack the tag into the output buffer.
Source§impl<'a> FieldUnpackHelper<'a, message<HostID>> for HostID
impl<'a> FieldUnpackHelper<'a, message<HostID>> for HostID
Source§fn merge_field(&mut self, proto: message<HostID>)
fn merge_field(&mut self, proto: message<HostID>)
Merge the proto into self.
Source§impl Ord for HostID
impl Ord for HostID
Source§impl Packable for HostID
impl Packable for HostID
Source§fn pack_sz(&self) -> usize
fn pack_sz(&self) -> usize
pack_sz
returns the number of bytes required to serialize the Packable object.Source§fn pack(&self, buf: &mut [u8])
fn pack(&self, buf: &mut [u8])
pack
fills in the buffer out
with the packed binary representation of the Packable
object. The implementor is responsible to ensure that out
is exactly pack_sz()
bytes
and implementations are encouraged to assert this. Read moreSource§fn stream<W>(&self, writer: &mut W) -> Result<usize, Error>
fn stream<W>(&self, writer: &mut W) -> Result<usize, Error>
stream
writes the object to the provided writer using the same representation that would
be used in a call to pack
. The implementor is responsible for making sure that the
number of bytes written is exactly equal to the number of required bytes. Read moreSource§impl PartialOrd for HostID
impl PartialOrd for HostID
Source§impl<'a> Unpackable<'a> for HostID
impl<'a> Unpackable<'a> for HostID
impl Copy for HostID
impl Eq for HostID
impl<'a> Message<'a> for HostID
impl StructuralPartialEq for HostID
Auto Trait Implementations§
impl Freeze for HostID
impl RefUnwindSafe for HostID
impl Send for HostID
impl Sync for HostID
impl Unpin for HostID
impl UnwindSafe for HostID
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more