pub struct FederationId(/* private fields */);Expand description
A federation routing namespace.
Implementations§
Source§impl FederationId
impl FederationId
Sourcepub const fn from_bytes(bytes: [u8; 32]) -> Self
pub const fn from_bytes(bytes: [u8; 32]) -> Self
Creates an ID from its fixed-width canonical bytes.
Examples found in repository?
examples/wire_benchmark.rs (line 34)
23fn signed_wire(body: Body) -> Vec<u8> {
24 let signer = SigningIdentity::new(
25 SigningKey::from_bytes(&[41; 32]),
26 MlDsaSigningKey::<MlDsa65>::from_seed(&B32::from([41; 32])),
27 );
28 let recipient = SigningIdentity::new(
29 SigningKey::from_bytes(&[42; 32]),
30 MlDsaSigningKey::<MlDsa65>::from_seed(&B32::from([42; 32])),
31 );
32 Envelope::sign(
33 &signer,
34 FederationId::from_bytes([1; 32]),
35 AttemptId::from_bytes([2; 16]),
36 recipient.endpoint(),
37 body,
38 )
39 .expect("bounded test envelope")
40 .encode()
41 .expect("canonical wire")
42}Trait Implementations§
Source§impl Clone for FederationId
impl Clone for FederationId
impl Copy for FederationId
Source§impl Debug for FederationId
impl Debug for FederationId
impl Eq for FederationId
Source§impl Hash for FederationId
impl Hash for FederationId
Source§impl Ord for FederationId
impl Ord for FederationId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for FederationId
impl PartialEq for FederationId
Source§impl PartialOrd for FederationId
impl PartialOrd for FederationId
impl StructuralPartialEq for FederationId
Auto Trait Implementations§
impl Freeze for FederationId
impl RefUnwindSafe for FederationId
impl Send for FederationId
impl Sync for FederationId
impl Unpin for FederationId
impl UnsafeUnpin for FederationId
impl UnwindSafe for FederationId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more