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>, SignalProtocolError> { ... }
fn deserialize(data: &[u8]) -> Result<Self, SignalProtocolError>
where Self: Sized { ... }
fn id(&self) -> Result<Self::Id, SignalProtocolError> { ... }
fn timestamp(&self) -> Result<Timestamp, SignalProtocolError> { ... }
fn signature(&self) -> Result<Vec<u8>, SignalProtocolError> { ... }
fn public_key(
&self,
) -> Result<<Self::KeyPair as KeyPairSerde>::PublicKey, SignalProtocolError> { ... }
fn key_pair(&self) -> Result<Self::KeyPair, SignalProtocolError> { ... }
}Required Associated Types§
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],
) -> Selfwhere
Self: Sized,
fn serialize(&self) -> Result<Vec<u8>, SignalProtocolError>
fn deserialize(data: &[u8]) -> Result<Self, SignalProtocolError>where
Self: Sized,
fn id(&self) -> Result<Self::Id, SignalProtocolError>
fn timestamp(&self) -> Result<Timestamp, SignalProtocolError>
fn signature(&self) -> Result<Vec<u8>, SignalProtocolError>
fn public_key( &self, ) -> Result<<Self::KeyPair as KeyPairSerde>::PublicKey, SignalProtocolError>
fn key_pair(&self) -> Result<Self::KeyPair, SignalProtocolError>
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.