Struct ids::InviteSecret
zaun_community_protocol::ids::InviteSecret · Struct
pub struct InviteSecret(…)An invitation secret: 32 random bytes, shown once. Never logged: Debug is redacted and
it has no Display. Zeroized on drop.
Methods
Section titled “Methods”from_bytes
Section titled “from_bytes”pub const fn from_bytes(bytes: [u8; 32]) -> SelfWraps raw bytes.
random
Section titled “random”pub fn random() -> Result<Self, RngError>A fresh secret.
Errors
Section titled “Errors”RngError when the CSPRNG fails.
expose
Section titled “expose”pub const fn expose(&self) -> &[u8; 32]The raw bytes (for hashing before storage; hosts store only a hash).
expose_b64
Section titled “expose_b64”pub fn expose_b64(&self) -> StringBase64url, for the one place it is shown: the invitation link.
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.
Trait implementations
Section titled “Trait implementations”Clone, Debug, Deserialize<'de>, Drop, Eq, PartialEq, Serialize, StructuralPartialEq, Zeroize