Skip to main content

Crate polybox

Crate polybox 

Source
Expand description

Message-passing abstractions to make working with channels and actors a more seamless experience.

See GitHub for more information.

Macros§

Set
Create a Set from a list of types.

Structs§

BoxedPayload
Holds a MessageSpecifier::Payload
DynInbox
A dynamic inbox that can accept messages of any type, as long as they are part of the specified set.
FireAndForget
A marker type for fire-and-forget messages.
FlumeInbox
A wrapper around a flume::Sender that acts as a PolyBox.
Halted
This process has been halted and should now exit.
Request
A marker type for request messages.
Rx
The receiver part of a request, created with new_request.
RxError
Error returned when receiving a message using an Rx.
SendError
The channel has been closed, and no longer accepts new messages.
Set
Marker struct to act as a set of elements.
TokioInbox
A wrapper around a tokio::sync::mpsc::Sender that acts as a PolyBox.
Tx
The transmitter part of a request, created with new_request.
TxError
Error returned when sending a message using a Tx.

Enums§

RecvError
Error returned when receiving a message.
RequestError
Error returned when sending a request.
SendCheckedError
Error returned when sending a message, checking at compile-time that the message is actually accepted by the actor.
TryRecvError
Error returned when trying to receive a message.
TryRequestError
Error returned when trying to send a request.
TryRxError
Error returned when trying to receive a message using an Rx.
TrySendCheckedError
Error returned when trying to send a message, checking at compile-time that the message is actually accepted by the actor.
TrySendError
An error returned when trying to send a message.

Traits§

AsSet
Trait that allows usage of custom types instead of [Set].
Contains
Implemented if a set contains the element E.
DynPolyBox
Object-safe sub-trait of PolyBox, allowing for dynamic dispatch.
FromPayload
Interface
An interface defines the set of messages that can be sent to a given actor. This is usually derived on an enum using the #[derive(Interface)] macro.
Members
Trait to get the members (type-ids) of a set.
Message
A trait that must be implemented for all types that are sent as messages.
MessageExt
A trait that extends Message with some helper methods.
MessageReply
A trait for types that can be used as the output of a Message.
MessageSpecifier
A trait for types that can be used to specify the kind of a Message.
PolyBox
A trait that allows for conversions to DynInbox.
PolyboxExt
A trait that extends PolyBox with some helper methods.
Sends
Implemented for inboxes that can send messages of type T.
SendsExt
Extension trait for Sends.
TryIntoPayload

Functions§

new_request
Create a new request, consisting of a Tx<T> and an Rx<T>. The Tx (transmitter) can be used to send a single message T to the Rx (receiver).

Type Aliases§

Output
A helper type for the output of a Message.
Payload
A helper type for the payload of a Message.
Reply
A helper type for the reply of a Message.

Derive Macros§

Interface
Derives the Interface trait for an enum, allowing it to be used as a message interface in the Polybox framework.
Message
Derives the Message trait for a struct, allowing it to be used as a message in the Polybox framework.