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.
Methods
Section titled “Methods”from_bytes
Section titled “from_bytes”pub const fn from_bytes(bytes: [u8; 8]) -> SelfWraps raw bytes (deterministic encoding, tests).
random
Section titled “random”pub fn random() -> Result<Self, RngError>A fresh id from the OS CSPRNG.
Errors
Section titled “Errors”RngError when the CSPRNG fails.
as_bytes
Section titled “as_bytes”pub const fn as_bytes(&self) -> &[u8; 8]The raw bytes.
from_b64
Section titled “from_b64”pub fn from_b64(text: &str) -> Option<Self>Strict base64url of exactly FRAG_ID_CHARS characters.
to_b64
Section titled “to_b64”pub fn to_b64(&self) -> StringBase64url without padding (11 characters).
Trait implementations
Section titled “Trait implementations”Clone, Copy, Debug, Eq, Hash, PartialEq, StructuralPartialEq