pub struct ShortUserPk(/* private fields */);Expand description
A UserPk shortened to its first four bytes (8 hex chars).
Implementations§
Source§impl ShortUserPk
impl ShortUserPk
pub const fn new(bytes: [u8; 4]) -> Self
Sourcepub fn is_prefix_of(&self, long: &UserPk) -> bool
pub fn is_prefix_of(&self, long: &UserPk) -> bool
Whether this ShortUserPk is a prefix of the given UserPk.
Trait Implementations§
Source§impl AsRef<[u8]> for ShortUserPk
impl AsRef<[u8]> for ShortUserPk
Source§impl ByteArray<4> for ShortUserPk
impl ByteArray<4> for ShortUserPk
fn from_array(array: [u8; 4]) -> Self
fn to_array(&self) -> [u8; 4]
fn as_array(&self) -> &[u8; 4]
fn as_slice(&self) -> &[u8] ⓘ
fn to_vec(&self) -> Vec<u8> ⓘ
fn try_from_slice(slice: &[u8]) -> Result<Self, TryFromSliceError>
fn try_from_vec(vec: Vec<u8>) -> Result<Self, TryFromSliceError>
fn from_hex(s: &str) -> Result<Self, DecodeError>
fn to_hex(&self) -> String
fn as_hex_display(&self) -> HexDisplay<'_>
fn fmt_as_hex(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§impl Clone for ShortUserPk
impl Clone for ShortUserPk
Source§fn clone(&self) -> ShortUserPk
fn clone(&self) -> ShortUserPk
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ShortUserPk
impl Debug for ShortUserPk
Source§impl<'de> Deserialize<'de> for ShortUserPk
impl<'de> Deserialize<'de> for ShortUserPk
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ShortUserPk
impl Display for ShortUserPk
Source§impl From<&UserPk> for ShortUserPk
impl From<&UserPk> for ShortUserPk
Source§impl FromHex for ShortUserPk
impl FromHex for ShortUserPk
Source§impl FromStr for ShortUserPk
impl FromStr for ShortUserPk
Source§impl Hash for ShortUserPk
impl Hash for ShortUserPk
Source§impl PartialEq for ShortUserPk
impl PartialEq for ShortUserPk
Source§impl RefCast for ShortUserPk
impl RefCast for ShortUserPk
Source§impl Serialize for ShortUserPk
impl Serialize for ShortUserPk
impl Copy for ShortUserPk
impl Eq for ShortUserPk
impl StructuralPartialEq for ShortUserPk
Auto Trait Implementations§
impl Freeze for ShortUserPk
impl RefUnwindSafe for ShortUserPk
impl Send for ShortUserPk
impl Sync for ShortUserPk
impl Unpin for ShortUserPk
impl UnsafeUnpin for ShortUserPk
impl UnwindSafe for ShortUserPk
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