Struct ids::BanId
zaun_community_protocol::ids::BanId · Struct
pub struct BanId(…)A ban record.
Methods
Section titled “Methods”from_bytes
Section titled “from_bytes”pub const fn from_bytes(bytes: [u8; 16]) -> SelfWraps raw bytes.
as_bytes
Section titled “as_bytes”pub const fn as_bytes(&self) -> &[u8; 16]The raw bytes.
from_slice
Section titled “from_slice”pub fn from_slice(bytes: &[u8]) -> Option<Self>Parses a byte slice of exactly Self::LEN bytes.
from_b64
Section titled “from_b64”pub fn from_b64(text: &str) -> Result<Self, B64Error>Strict base64url.
Errors
Section titled “Errors”A non-canonical encoding or a wrong length.
to_b64
Section titled “to_b64”pub fn to_b64(&self) -> StringBase64url without padding.
random
Section titled “random”pub fn random() -> Result<Self, RngError>A fresh id from the OS CSPRNG; never all-zero (all-zero is reserved, the protocol).
Errors
Section titled “Errors”RngError when the CSPRNG fails.
Trait implementations
Section titled “Trait implementations”Clone, Copy, Debug, Deserialize<'de>, Display, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize, StructuralPartialEq