pub struct Invitation {
pub secret: [u8; 32],
pub expires: SystemTime,
pub uses: u32,
pub label: String,
}Expand description
A one-time pairing secret: whoever presents it may pair, until it expires or its uses run out.
The store keeps only the id, never the secret: the caller hands the
secret to the joiner (a link or QR code, with the inviter’s id). Debug does not show it.
Fields§
§secret: [u8; 32]The secret, 32 random bytes.
expires: SystemTimeWhen it stops being redeemable.
uses: u32Redemptions left: as made by TrustStore::invite, or after this one by
TrustStore::redeem.
label: StringThe inviter’s note on whom it is for, one line of at most MAX_LABEL bytes.
Implementations§
Source§impl Invitation
impl Invitation
Sourcepub fn id(&self) -> InvitationId
pub fn id(&self) -> InvitationId
The invitation’s id.
Trait Implementations§
Source§impl Clone for Invitation
impl Clone for Invitation
Source§impl Debug for Invitation
impl Debug for Invitation
Source§impl Drop for Invitation
impl Drop for Invitation
impl Eq for Invitation
Source§impl PartialEq for Invitation
impl PartialEq for Invitation
impl StructuralPartialEq for Invitation
Auto Trait Implementations§
impl Freeze for Invitation
impl RefUnwindSafe for Invitation
impl Send for Invitation
impl Sync for Invitation
impl Unpin for Invitation
impl UnsafeUnpin for Invitation
impl UnwindSafe for Invitation
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