nysiris-core 0.1.2

Shared primitives for Nysiris native clients: identity, message framing, crypto, contacts, and transport traits.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::error::Result;

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SentPayload {
    pub recipient: String,
    pub payload: Vec<u8>,
}

/// Transport adapter seam. The real implementation uses `nym-sdk`; tests use
/// an in-memory transport. The core never opens a socket itself.
pub trait Transport: Send + Sync {
    fn name(&self) -> &'static str {
        "unknown"
    }

    fn send(&self, recipient: &str, payload: Vec<u8>) -> Result<()>;
}