Trait GenericSignedPreKey

Source
pub trait GenericSignedPreKey {
    type KeyPair: KeyPairSerde;
    type Id: From<u32> + Into<u32>;

    // Required methods
    fn get_storage(&self) -> &SignedPreKeyRecordStructure;
    fn from_storage(storage: SignedPreKeyRecordStructure) -> Self;

    // Provided methods
    fn new(
        id: Self::Id,
        timestamp: Timestamp,
        key_pair: &Self::KeyPair,
        signature: &[u8],
    ) -> Self
       where Self: Sized { ... }
    fn serialize(&self) -> Result<Vec<u8>> { ... }
    fn deserialize(data: &[u8]) -> Result<Self>
       where Self: Sized { ... }
    fn id(&self) -> Result<Self::Id> { ... }
    fn timestamp(&self) -> Result<Timestamp> { ... }
    fn signature(&self) -> Result<Vec<u8>> { ... }
    fn public_key(&self) -> Result<<Self::KeyPair as KeyPairSerde>::PublicKey> { ... }
    fn key_pair(&self) -> Result<Self::KeyPair> { ... }
}

Required Associated Types§

Source

type KeyPair: KeyPairSerde

Source

type Id: From<u32> + Into<u32>

Required Methods§

Source

fn get_storage(&self) -> &SignedPreKeyRecordStructure

Source

fn from_storage(storage: SignedPreKeyRecordStructure) -> Self

Provided Methods§

Source

fn new( id: Self::Id, timestamp: Timestamp, key_pair: &Self::KeyPair, signature: &[u8], ) -> Self
where Self: Sized,

Source

fn serialize(&self) -> Result<Vec<u8>>

Source

fn deserialize(data: &[u8]) -> Result<Self>
where Self: Sized,

Source

fn id(&self) -> Result<Self::Id>

Source

fn timestamp(&self) -> Result<Timestamp>

Source

fn signature(&self) -> Result<Vec<u8>>

Source

fn public_key(&self) -> Result<<Self::KeyPair as KeyPairSerde>::PublicKey>

Source

fn key_pair(&self) -> Result<Self::KeyPair>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§