Crate nemo [−] [src]
Nemo provides session type abstractions for asynchronous networking protocols. It can be used to build high performance, memory safe and type-safe protocol implementations.
What are session types?
Session types allow you to encode the description of a protocol in the type system. The goal is to ensure that two clients can never disagree about their state or expectations when communicating. Through session types, it is possible to define protocols that must be implemented properly -- your code simply will not compile otherwise.
Modules
channels |
Channels are implementations of |
peano |
Peano numbers are natural numbers expressed as successions of zero. We use them in our API to provide "nested" protocol escaping, as you must indicate the number of layers you wish to escape from. |
session_types |
Session types encode the current state of a communication channel. It is not possible to change to another state without following the protocol. |
Macros
handlers | |
proto |
Structs
Channel |
Channels are provided to handlers to act as a "courier" for the session type and a guard for the IO backend. |
Defer |
Handlers must return |
Traits
Handler |
|
IO |
This trait is implemented by backing IO structures to offer an
interface for bi-directional channels. Discriminants are sent
and received by |
Protocol |
A |
Transfers |
An implementation of this trait provides sending and receiving
functionality to |
Functions
channel | |
channel_dual |