pub struct ContactMessage {
pub sender_prefix: [u8; 6],
pub path_len: u8,
pub txt_type: u8,
pub sender_timestamp: u32,
pub text: String,
pub snr: Option<f32>,
pub signature: Option<[u8; 4]>,
}Expand description
Contact message - a direct message from a contact (identified by sender public key prefix)
Fields§
§sender_prefix: [u8; 6]Sender public key prefix (6 bytes)
path_len: u8Path length
txt_type: u8Text type (0 = plain, 2 = signed)
sender_timestamp: u32Sender timestamp
text: StringMessage text
snr: Option<f32>SNR (only in v3, divided by 4)
signature: Option<[u8; 4]>Signature (if txt_type == 2)
Implementations§
Source§impl ContactMessage
impl ContactMessage
Sourcepub fn message_id(&self) -> u64
pub fn message_id(&self) -> u64
Generate a “unique-ish” message ID for this message
Sourcepub fn sender_prefix_hex(&self) -> String
pub fn sender_prefix_hex(&self) -> String
Get the sender prefix as a hex string
Trait Implementations§
Source§impl Clone for ContactMessage
impl Clone for ContactMessage
Source§fn clone(&self) -> ContactMessage
fn clone(&self) -> ContactMessage
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 ContactMessage
impl RefUnwindSafe for ContactMessage
impl Send for ContactMessage
impl Sync for ContactMessage
impl Unpin for ContactMessage
impl UnsafeUnpin for ContactMessage
impl UnwindSafe for ContactMessage
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