Crate thespis_impl
source ·Expand description
thespis_impl
The reference implementation of the thespis actor model
This crate implements the traits from the thespis
crate. It provides what you need to use actors.
Please check out the guide level documentation.
Table of Contents
Install
With cargo add:
cargo add thespis_impl
With cargo yaml:
dependencies:
thespis_impl: ^0.3
In Cargo.toml:
[dependencies]
thespis_impl = "0.3"
Upgrade
Please check out the changelog when upgrading.
Dependencies
This crate has few dependencies. Cargo will automatically handle it’s dependencies for you.
Security
It is recommended to always use cargo-crev to verify the trustworthiness of each of your dependencies, including this one.
This crate has #![forbid(unsafe_code)]
, but our dependencies do use unsafe.
Usage
Please check out the guide level documentation and the examples in the repository.
API
API documentation can be found on docs.rs.
Contributing
Please check out the contribution guidelines.
Testing
cargo test --all-features
.
Code of conduct
Any of the behaviors described in point 4 “Unacceptable Behavior” of the Citizens Code of Conduct are not welcome here and might get you banned. If anyone, including maintainers and moderators of the project, fail to respect these/your limits, you are entitled to call them out.
License
Structs
- Information about an actor, id, name and type_name. It implements
Identify
. Can also generate a span for tracing. - Reference implementation of
thespis::Address<M>
. It can be used to send all message types the actor implementsthespis::Handler
for. - The mailbox implementation.
- This is an address with similar functionality as
Addr
, but it does not keep the mailbox alive.
Enums
- Type returned to you by the mailbox when it ends. Await the JoinHandle returned by the executor to retrieve this.
- Errors that can happen in thespis_impl.
Constants
- Default buffer size for bounded channel between Addr and Mailbox.
Traits
- Interface for
T: Sink + Clone + Unpin + Send
. This is object safe, so you can clone on a boxed trait. In thespis_impl it is used for the channel sender that goes in the actor address. - Helper trait to smoothen API for converting a
T:
CloneSink
intoChanSender
, which isBox< dyn CloneSink<'static, BoxEnvelope<A>, DynError> >
. - An extension trait for
Sink
s that provides a variety of convenient combinator functions.
Functions
- Turn into a boxed error
Type Definitions
- Shorthand for a
Send
boxed envelope. - Type of boxed channel receiver for Mailbox.
- Type of boxed channel sender for Addr. Can be created conveniently with
CloneSinkExt::dyned
, but that is rarely needed as you can use theActorBuilder
to override default channels. - A boxed error type for the sink
- Result which has a ThesErr as error type.