pub struct NameHash(pub [u8; 4]);Expand description
4-byte name hash (§7.3.4.5 — “MD5(name)[0..4]”).
Stored in the MinimalTypeObject instead of the full name, to keep the payload small. In the CompleteTypeObject the full name is additionally present.
Tuple Fields§
§0: [u8; 4]Implementations§
Source§impl NameHash
impl NameHash
Sourcepub fn from_name(name: &str) -> Self
pub fn from_name(name: &str) -> Self
Computes the 4-byte NameHash from a member/literal name.
Spec §7.3.4.5: “the name_hash is computed as the first 4
octets of the MD5 hash of the name, interpreted as ASCII/UTF-8”.
Sourcepub fn encode_into(&self, w: &mut BufferWriter) -> Result<(), EncodeError>
pub fn encode_into(&self, w: &mut BufferWriter) -> Result<(), EncodeError>
Sourcepub fn decode_from(r: &mut BufferReader<'_>) -> Result<Self, DecodeError>
pub fn decode_from(r: &mut BufferReader<'_>) -> Result<Self, DecodeError>
Trait Implementations§
impl Copy for NameHash
impl Eq for NameHash
Source§impl Ord for NameHash
impl Ord for NameHash
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for NameHash
impl PartialOrd for NameHash
impl StructuralPartialEq for NameHash
Auto Trait Implementations§
impl Freeze for NameHash
impl RefUnwindSafe for NameHash
impl Send for NameHash
impl Sync for NameHash
impl Unpin for NameHash
impl UnsafeUnpin for NameHash
impl UnwindSafe for NameHash
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