[][src]Struct mesher::Mesher

pub struct Mesher { /* fields omitted */ }

The control interface for a single mesher.

One important thing to note is that the Mesher struct only stores keys during runtime. It does not manage them in any other way, e.g. keeping them securely on-disk, transmitting them securely to the computer, etc. (However, you could well use messages passed through mesher to handle some of it.)

Methods

impl Mesher[src]

pub fn signed(own_skeys: Vec<SecretKey>, sender_pkeys: Vec<PublicKey>) -> Mesher[src]

Creates a mesher which expects incoming messages to be signed with one of the given keys.

Note that there are no (explicit) markers to differentiate between signed and unsigned meshers' packets. Signed meshers will expect their incoming packets to have signatures; unsigned meshers won't. If a signing mesher receives an unsigned packet or vice versa, it'll be a no-op.

pub fn unsigned(own_skeys: Vec<SecretKey>) -> Mesher[src]

Creates a mesher which doesn't sign its outgoing messages. The keys are used when receiving messages, to decrypt the ones meant for it.

Note that there are no (explicit) markers to differentiate between signed and unsigned meshers. Signed meshers will expect their incoming packets to have signatures; unsigned meshers won't. If a signing mesher receives an unsigned packet or vice versa, it'll be a no-op.

pub fn add_transport<T: Transport + 'static>(
    &mut self,
    scheme: &str
) -> Result<()>
[src]

Adds a transport to the mesher, for it to send and receive data through. The scheme is passed to the transport exactly as-is. If an initialization error occurs in the transport, nothing is added to the internal scheme mapping.

pub fn listen_on(&mut self, path: &str) -> Result<()>[src]

Has the mesher listen on the given path for messages. This determines the transport to connect to based on the scheme, then just tells it to listen. The exact behavior depends on the transport, but will generally involve either setting up some listener, or adding it to a list of internal paths to poll.

pub fn launch(&mut self, packet: Packet) -> Result<()>[src]

Sends a packet out.

Note that while the outgoing packet is processed like any incoming one, any messages destined for this mesher are ignored.

pub fn receive(&mut self) -> Result<Vec<Message>>[src]

Gets pending messages from all of the transports along all of the paths they've been told to use.

Auto Trait Implementations

impl !RefUnwindSafe for Mesher

impl !Send for Mesher

impl !Sync for Mesher

impl Unpin for Mesher

impl !UnwindSafe for Mesher

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,