ipmail 0.1.0

Rust implementation of SP-centric decentralized instant message synchronization protocol(DIMSP)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Mail sender trait

use std::{future::Future, io::Result};

use crate::mail::Message;

/// Mail sender.
pub trait Sender {
    type Send<'cx>: Future<Output = Result<usize>> + Send + Unpin + 'cx
    where
        Self: 'cx;

    /// Send mail brief asynchronously and returns sending queue length.
    fn send<'cx, 'a>(&'a mut self, message: Message) -> Self::Send<'cx>
    where
        'a: 'cx;
}