pub struct AttemptId(/* private fields */);Expand description
A fresh application-provided connection-attempt ID.
Implementations§
Source§impl AttemptId
impl AttemptId
Sourcepub const fn from_bytes(bytes: [u8; 16]) -> Self
pub const fn from_bytes(bytes: [u8; 16]) -> Self
Creates an ID from fixed-width canonical bytes.
Examples found in repository?
examples/wire_benchmark.rs (line 35)
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§
impl Copy for AttemptId
impl Eq for AttemptId
Source§impl Ord for AttemptId
impl Ord for AttemptId
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 PartialOrd for AttemptId
impl PartialOrd for AttemptId
impl StructuralPartialEq for AttemptId
Auto Trait Implementations§
impl Freeze for AttemptId
impl RefUnwindSafe for AttemptId
impl Send for AttemptId
impl Sync for AttemptId
impl Unpin for AttemptId
impl UnsafeUnpin for AttemptId
impl UnwindSafe for AttemptId
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