Expand description

Re-exports of types – out of the internal directory and module structure – useful for users of this crate

Macros§

Structs§

  • Abstracts out the TCP/IP intricacies for establishing (and retrying) connections, while still enabling the “Protocol Stack Composition” pattern by accepting existing connections to be provided (instead of opening new ones).
  • Real definition & implementation for our Socket Client, full of generic parameters.
    Probably you want to instantiate this structure through the sugared macros new_socket_client!() or new_composite_socket_client!() instead. Generic Parameters:
  • Real definition & implementation for our Socket Server, full of generic parameters.
    Probably you want to instantiate this structure through the sugared macros new_socket_server!() or new_composite_socket_server!() instead. Generic Parameters:
  • The abstraction for handling server connections – here, the connections are provided through a Stream instead of through the TCP/IP API directly. This enables the “Protocol Stack Composition” pattern, as already existing connections may be also added to the Stream (in addition to fresh incoming ones).
    When the end-of-stream is reached (possibly due to a “server shutdown” request), the Stream will return None.
  • Implements something that could be called the “Zero-Cost Const Configuration Pattern”, that produces a usize whose goal is to be the only const parameter of a generic struct (avoiding the alternative of bloating it with several const params).
    When using the const “query functions” defined here in ifs, the compiler will have the opportunity to cancel out any unreachable code (zero-cost abstraction).
    Some commonly used combinations may be pre-defined in some enum variants, but you may always build unmapped possibilities through [Self::custom()].
    Usage examples:
  • Multi is an event handler capable of having several “listeners” – all of which receives all events.
    With this struct, it is possible to:
  • Special Stream implementation to avoid using dynamic dispatching, so to allow the compiler to fully optimize the whole event consumption chain.
    The following paths are covered:
  • Wrapper type for data providing an atomic reference counter for dropping control, similar to Arc, but allowing a custom allocator to be used – OgreAllocator. providing reference counting similar to Arc
  • Wrapper type for data that requires a custom Drop to be called (through an OgreAllocator). Similar to C++’s unique_ptr
  • Represents a reactive channel connected to a remote peer, through which we’re able to send out “local messages” of type RetryableSenderImpl::LocalMessages.
    the Self::send() method honors whatever retrying config is specified in [RetryableSenderImpl::CONST_CONFIG]. IMPLEMENTATION NOTE: GAT traits (to reduce the number of generic parameters) couldn’t be used here – even after applying this compiler bug workaround https://github.com/rust-lang/rust/issues/102211#issuecomment-1513931928 – the “error: implementation of std::marker::Send is not general enough” bug kept on popping up in user provided closures that called other async functions.
  • Indicates the receiver end of a channel was dropped, therefore the element of type T couldn’t be sent and is being returned back along with the error indication.
    Important: This is an unrecoverable situation, so trying again is futile.
  • Abstracts out, from servers, the connection handling so to enable the “Protocol Stack Composition” pattern:
    Binds to a network listening interface and port and starts a network event loop for accepting connections, supplying them to an internal ConnectionChannel (while also allowing manually fed connections).
  • A wrapper for a TcpStream – attaching a custom “state” and unique id to it.
    This abstraction plays a role in enabling the “Composite Protocol Stacking” design pattern.
    IMPLEMENTATION NOTE: The crate::prelude::Peer object still holds a copy of the state – synced elsewhere with us here – in the future, this should be reworked.
  • Socket options for the local peer to be set when the connection is established
  • Contains the producer-side Uni handle used to interact with the uni event – for closing the stream, requiring stats, …

Enums§

  • Event issued by Composite Protocol Clients & Servers when connections are made or dropped
  • Honors the Zero-Cost Instrumentation Pattern for the [stream_executors]:
    Designed to be used as a const generic parameter for Structs, causes the conditional instrumentation code in client structs to be selectively compiled – see the implemented const methods for documentation of each available instrument.
  • Event issued by Composite Protocol Clients & Servers to their Reactive Processors.
    The user code may use those events to maintain a list of connected parties, be notified of stop/close/quit requests, init/de-init sessions, etc. Note that the Peer objects received in those events may be used, at any time, to send messages to the remote party – like “Shutting down. Goodbye”. IMPLEMENTATION NOTE: GAT traits (to reduce the number of generic parameters) couldn’t be used here – even after applying this compiler bug workaround https://github.com/rust-lang/rust/issues/102211#issuecomment-1513931928 – the “error: implementation of std::marker::Send is not general enough” bug kept on popping up in user provided closures that called other async functions.
  • Specifies how to behave when communication failures happen

Traits§

  • Defines common abstractions on how [Uni]s receives produced events and delivers them to Streams.
    Implementors should also implement one of ChannelProducer or [UniZeroCopyChannel]. NOTE: all async functions are out of the hot path, so the async_trait won’t impose performance penalties
  • Source of events for MutinyStream.
  • Defines abstractions specific to [Uni] channels
  • Defines how to send events (to a [Uni] or [Multi]).
  • Defines abstractions specific to [Uni] channels
  • A fully fledged Multi channel, that has both the producer and consumer parts Also, laverages generic programming by allowing simpler generic parameters:
  • Defines a fully fledged Uni channel, that has both the producer and consumer parts Also, laverages generic programming by allowing simpler generic parameters:
  • This trait exists to allow simplifying generic declarations of concrete Multi types. See also [GenericUni].
    Usage:
  • This trait exists to allow simplifying generic declarations of concrete Uni types. See also [GenericMulti].
    Usage:
  • Base trait for server and client services functionalities
  • Dictates how data slots should be acquired and returned for future reuse.
    Two APIs are available:
  • Trait that should be implemented by enums that model the “remote messages” to be consumed by a “Responsive Processor” – “remote messages” may either be messages produced by the remote server or by the remote client (when we are implementing the opposite peer).
    This trait, therefore, specifies how to deserialize() enum variants received by the remote peer (like RON, for textual protocols)
  • Trait that should be implemented by enums that model the “local messages” to be sent to the remote peer – “local messages” may either be messages generated by the server or by the client, depending on if you’re building a server or client.
    This trait, therefore, specifies how to:
  • Adherents will, typically, also implement [ReactiveMessagingUnresponsiveSerializer].
    By upgrading your type with this trait, it is possible to build a “Responsive Processor”, where the returned Stream contains the messages to be sent as an answer to the remote peer.
    This trait, therefore, specifies (to the internal sender) how to handle special response cases, like “no answer” and “disconnection” messages.

Functions§

Type Aliases§