Skip to main content

Module stream

Module stream 

Available on crate feature std only.

Modules§

adapters
Adapters for Streams created by methods in StreamExt.
codec
Adaptors from AsyncRead/AsyncWrite to Stream/Sink
io
Helpers for IO related tasks.
json
ndjson support in rama
wrappers
Wrappers for Tokio types that implement Stream.

Structs§

BytesFreeze
Wraps a duplex Stream + Sink that decodes to BytesMut and accepts Bytes in its sink, exposing a uniform Stream<Bytes> + Sink<Bytes> on top.
CostFn
An ItemCost pricing items with a closure, see PacedSink::with_cost_fn.
Elapsed
Error returned by Timeout and TimeoutRepeating.
Empty
Stream for the empty function.
Iter
Stream for the iter function.
Once
Stream for the once function.
PacedSink
A Sink combinator that paces the items sent through it against a token bucket: the go-to way to rate datagram flows.
Pending
Stream for the pending function.
StreamBridge
Input to StreamForwardService: the two duplex endpoints to bridge.
StreamForwardService
A Service which takes a StreamBridge and pumps frames between the two endpoints bidirectionally.
StreamMap
Combine many streams into one, indexing each source stream with a unique key.
StreamNotifyClose
A Stream that wraps the values in an Option.
Timeout
Stream returned by the timeout method.

Enums§

BridgeCloseReason
Reason why a rama bridge — byte-oriented (see IoForwardService in rama-net) or frame-oriented (see StreamForwardService) — terminated.

Traits§

DatagramCost
The intrinsic cost of a datagram-ish item: its byte length.
FromStream
Convert from a Stream.
ItemCost
Prices the items sent through a PacedSink.
Stream
A stream of values produced asynchronously.
StreamExt
An extension trait for the Stream trait that provides a variety of convenient combinator functions.

Functions§

empty
Creates a stream that yields nothing.
iter
Converts an Iterator into a Stream which is always ready to yield the next value.
once
Creates a stream that emits an element exactly once.
pending
Creates a stream that is never ready