Skip to content

Struct crypto::voice::VoiceSessionId

zaun_community_protocol::crypto::voice::VoiceSessionId · Struct

pub struct VoiceSessionId(…)

One participation in a voice channel. A member draws a fresh one on every join, so KIDs and epochs never repeat across joins.

pub fn random() -> Result<Self, RngError>

A fresh, non-zero session id.

RngError when the CSPRNG fails.

pub const fn from_bytes(bytes: [u8; 16]) -> Self

Wraps raw bytes.

pub const fn as_bytes(&self) -> &[u8; 16]

The raw bytes.

pub fn to_b64(&self) -> String

Unpadded base64url, like every other id.

pub fn from_b64(text: &str) -> Result<Self, B64Error>

Parses unpadded base64url.

b64::B64Error for bad text or the wrong length.

Clone, Copy, Debug, Deserialize<'de>, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize, StructuralPartialEq

Full rustdoc page