Skip to main content

Module session

Module session 

Source
Expand description

Sessions and lanes.

r[impl jetstream.session.overview] A session is the association with a peer: it carries identity and capabilities and can open and accept lanes. A lane is one ordered, reliable, flow-controlled sequence of frames — exactly what ClientTransport describes from one end and ServiceTransport from the other. A session orders nothing; ordering is a property of a lane and only of a lane.

r[impl jetstream.session.overview.additive] Nothing here changes the ClientTransport or ServiceTransport bounds. A lane is a value satisfying them; what a session adds is a way to obtain one without naming the concrete transport. Code that holds a single transport and multiplexes by tag keeps working.

Re-exports§

pub use self::lifetime::LaneGuard;
pub use self::local::LocalSession;
pub use self::local::LocalSessionPair;

Modules§

lifetime
Session-scoped lane lifetime.
local
Sessions between two peers in one process.

Structs§

Capabilities
What a session can do.
LaneOrder
Hands out delivery order for one lane.
NoClientLane
The caller’s end of a lane a session can never open.
NoServiceLane
The callee’s end of a lane a session can never accept.
OrderTicket
One frame’s place in a lane’s delivery order.
SingleLaneSession
A session over a transport that carries exactly one lane.

Enums§

Capability
A single capability, named so that a session can say what it is missing when code asks for something it does not have.
IdentityKind
The peer identity model a session’s transport establishes.
LaneSupport
How many lanes a session can carry.
SessionError
Something a session was asked to do and could not.

Traits§

Datagrams
The optional unordered channel belonging to a session.
Session
An association with a peer, from which lanes are obtained.

Functions§

check_datagram_size
r[impl jetstream.session.datagrams] Reject an oversized frame at the send site, which is the only place that can report it: a frame that exceeds the path limit is not fragmented, so there is nothing further down to notice.
decode_datagram
r[impl jetstream.session.datagrams] Decode one datagram, which carries a complete frame or is discarded. There is nothing to reassemble it from, so bytes after the frame mean it is not a complete frame either: decoding would succeed on the prefix and hand back something the peer never sent.
encode_datagram
r[impl jetstream.session.datagrams] Encode a frame for the datagram channel, refusing one the path cannot carry.