[][src]Struct tcn::TemporaryContactKey

pub struct TemporaryContactKey { /* fields omitted */ }

A ratcheting key used to derive temporary contact numbers.

Methods

impl TemporaryContactKey[src]

pub fn index(&self) -> u16[src]

The current ratchet index.

pub fn temporary_contact_number(&self) -> TemporaryContactNumber[src]

Compute the temporary contact number derived from this key.

pub fn ratchet(self) -> Option<TemporaryContactKey>[src]

Ratchet the key forward, producing a new key for a new temporary contact number.

Returns

  • Some(new_key) if the current ratchet index is less than u16::MAX;
  • None if the current ratchet index is u16::MAX, signaling that the report authorization key should be rotated.

impl TemporaryContactKey[src]

pub fn read<R: Read>(reader: R) -> Result<TemporaryContactKey, Error>[src]

Try to read a TemporaryContactKey from a generic io::Reader.

pub fn write<W: Write>(&self, writer: W) -> Result<(), Error>[src]

Try to write a TemporaryContactKey into a generic io::Writeer.

Trait Implementations

impl Clone for TemporaryContactKey[src]

impl Copy for TemporaryContactKey[src]

impl Debug for TemporaryContactKey[src]

impl Eq for TemporaryContactKey[src]

impl PartialEq<TemporaryContactKey> for TemporaryContactKey[src]

impl StructuralEq for TemporaryContactKey[src]

impl StructuralPartialEq for TemporaryContactKey[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.