dnet utilities
dnet comes with the following set of utilities (under “utils” feature, enabled by default):
Filtering- wraps a transport and drops incoming or outgoing messages based on a predicate.Mapping- adapts a transport to a different message type by mapping outgoing messages and unmapping incoming ones.Split2,Split3,Split4, andSplit5- split a transport carrying a tagged message enum into multiple transports with different message types.Unwrapping- converts incoming messages that implementUnwrapinto their inner payloads.Latest- wraps a numbered transport and only exposes the newest messages, discarding older ones.ChannelTransport- transport over futures channels, useful for testing and debugging. Can be conveniently created withtransports()function.MergedTransport- merges a sink and stream into a single transport.Numbered- wraps a transport and adds sequence numbers to messages.Wall- a transport that rejects every operation, returning an error on send, receive, flush, or close.Void- a transport that accepts outgoing messages (but “sends” them into a ‘void’) and never produces incoming ones.
And:
Pipe- connects two transports in both directions so messages can flow back and forth. It is not a transport itself; it is a helper for linking two transports together.