pub struct NameHash(pub [u8; 4]);Expand description
4-byte Name-Hash (§7.3.4.5 — “MD5(name)[0..4]”).
Wird im MinimalTypeObject statt des vollen Namens gespeichert, um die Payload klein zu halten. Im CompleteTypeObject liegt der volle Name zusaetzlich vor.
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
Berechnet den 4-byte NameHash aus einem Member-/Literal-Namen.
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§
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 Copy for NameHash
impl Eq 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