pub fn insert_message(db_lock: Arc<Mutex<DB>>, message: Message) -> Result<(), Error> {
    let db = db_lock.lock().unwrap();
    let message_bytes = message.encode();
    let m: Vec<u8> = message
        .recipient_id
        .iter()
        .cloned()
        .chain(hash(&message_bytes))
        .collect();
    db.put(m, message_bytes).unwrap();
    Ok(())
}
/// Submit a single message. Used to send a single message.
Submit a single message. Used to send a single message.
Submit a single message . Used to send a single message .
pub fn insert_message(db_lock: Arc<Mutex<DB>>, message: Message) -> Result<(), Error> {
    let db = db_lock.lock().unwrap();
    let message_bytes = message.encode();
    let m: Vec<u8> = message
        .recipient_id
        .iter()
        .cloned()
        .chain(hash(&message_bytes))
        .collect();
    db.put(m, message_bytes).unwrap();
    Ok(())
}
pub fn insert_message ( db_lock : Arc < Mutex < DB > > , message : Message ) -> Result < ( ) , Error > { let db = db_lock . lock ( ) . unwrap ( ) ; let message_bytes = message . encode ( ) ; let m : Vec < u8 > = message . recipient_id . iter ( ) . cloned ( ) . chain ( hash ( & message_bytes ) ) . collect ( ) ; db . put ( m , message_bytes ) . unwrap ( ) ; Ok ( ( ) ) }
Submit a single message.
Submit a single message .
db_lock
Arc<Mutex<DB>>
message
Message
db_lock
Arc<Mutex<DB>>
message
Message