pub struct WireMessage {
pub destination: [u8; 16],
pub source: [u8; 16],
pub signature: Option<[u8; 64]>,
pub payload: Payload,
}Fields§
§destination: [u8; 16]§source: [u8; 16]§signature: Option<[u8; 64]>§payload: PayloadImplementations§
Source§impl WireMessage
impl WireMessage
pub fn new(destination: [u8; 16], source: [u8; 16], payload: Payload) -> Self
pub fn message_id(&self) -> [u8; 32]
pub fn sign(&mut self, signer: &PrivateIdentity) -> Result<(), LxmfError>
pub fn verify(&self, identity: &Identity) -> Result<bool, LxmfError>
pub fn pack(&self) -> Result<Vec<u8>, LxmfError>
pub fn pack_storage(&self) -> Result<Vec<u8>, LxmfError>
pub fn unpack(bytes: &[u8]) -> Result<Self, LxmfError>
pub fn unpack_from_file(path: impl AsRef<Path>) -> Result<Self, LxmfError>
pub fn unpack_storage(bytes: &[u8]) -> Result<Self, LxmfError>
pub fn unpack_storage_from_file( path: impl AsRef<Path>, ) -> Result<Self, LxmfError>
pub fn pack_to_file(&self, path: impl AsRef<Path>) -> Result<(), LxmfError>
pub fn pack_storage_to_file( &self, path: impl AsRef<Path>, ) -> Result<(), LxmfError>
pub fn pack_propagation_with_rng<R: CryptoRngCore + Copy>( &self, destination: &Identity, timestamp: f64, rng: R, ) -> Result<Vec<u8>, LxmfError>
pub fn pack_propagation_with_options_and_rng<R: CryptoRngCore + Copy>( &self, destination: &Identity, timestamp: f64, propagation_stamp: Option<&[u8]>, rng: R, ) -> Result<(Vec<u8>, [u8; 32]), LxmfError>
pub fn pack_propagation_transient_with_rng<R: CryptoRngCore + Copy>( &self, destination: &Identity, rng: R, ) -> Result<(Vec<u8>, [u8; 32]), LxmfError>
pub fn pack_propagation_envelope( timestamp: f64, lxmf_data: &[u8], propagation_stamp: Option<&[u8]>, ) -> Result<Vec<u8>, LxmfError>
pub fn pack_paper_with_rng<R: CryptoRngCore + Copy>( &self, destination: &Identity, rng: R, ) -> Result<Vec<u8>, LxmfError>
pub fn pack_paper_uri_with_rng<R: CryptoRngCore + Copy>( &self, destination: &Identity, rng: R, ) -> Result<String, LxmfError>
pub fn encode_lxm_uri(paper_bytes: &[u8]) -> String
pub fn decode_lxm_uri(uri: &str) -> Result<Vec<u8>, LxmfError>
Trait Implementations§
Source§impl Clone for WireMessage
impl Clone for WireMessage
Source§fn clone(&self) -> WireMessage
fn clone(&self) -> WireMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WireMessage
impl RefUnwindSafe for WireMessage
impl Send for WireMessage
impl Sync for WireMessage
impl Unpin for WireMessage
impl UnsafeUnpin for WireMessage
impl UnwindSafe for WireMessage
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