ipmail 0.1.0

Rust implementation of SP-centric decentralized instant message synchronization protocol(DIMSP)
Documentation
use std::{future::Future, io::Result};

use crate::mail::Message;

/// Mail receiver trait.
pub trait Receiver {
    type Current<'cx>: Future<Output = Result<Message>> + Send + Unpin + 'cx
    where
        Self: 'cx;

    type Next<'cx>: Future<Output = Result<bool>> + Send + Unpin + 'cx
    where
        Self: 'cx;

    /// Current forwarding mail from remote node.
    fn current<'cx, 'a>(&'a mut self) -> Self::Current<'cx>
    where
        'a: 'cx;

    /// Move receive cursor to next
    fn next<'cx, 'a>(&'a mut self) -> Self::Next<'cx>
    where
        'a: 'cx;
}