Skip to content

Struct framing::FragId

zaun_community_protocol::framing::FragId · Struct

pub struct FragId(…)

A fragment id: 8 random bytes, unique per sender per connection among open reassemblies.

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

Wraps raw bytes (deterministic encoding, tests).

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

A fresh id from the OS CSPRNG.

RngError when the CSPRNG fails.

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

The raw bytes.

pub fn from_b64(text: &str) -> Option<Self>

Strict base64url of exactly FRAG_ID_CHARS characters.

pub fn to_b64(&self) -> String

Base64url without padding (11 characters).

Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq

Full rustdoc page