Crate thespis_impl[][src]

Expand description

thespis_impl

standard-readme compliant Build Status Docs crates.io

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.1-alpha

In Cargo.toml:

[dependencies]

  thespis_impl = "0.1-alpha"

Upgrade

Please check out the changelog when upgrading.

Dependencies

This crate has few dependencies. Cargo will automatically handle it’s dependencies for you.

There is one optional feature: tokio_channel. This causes the ActorBuilder to use tokio channels by default instead of futures channels.

Security

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

Unlicence

Structs

ActorBuilder

Builder for Addr and Mailbox. This is a convenience API so you don’t have to call their constructors manually. Mainly lets you set the channel and name for your mailbox.

Addr

Reference implementation of thespis::Address<M>. It can be used to send all message types the actor implements thespis::Handler for. An actor will be dropped when all addresses to it are dropped.

Mailbox

The mailbox implementation.

RxStrong

This wraps a channel receiver in order to do an extra check when the channel returns pending. We want strong and weak addresses. When there are no strong addresses left, we shall return Poll::Ready(None) instead of Poll::Pending.

WeakAddr

Reference implementation of thespis::Address<M>. It can be used to send all message types the actor implements thespis::Handler for. An actor will be dropped when all addresses to it are dropped.

Enums

MailboxEnd

Type returned to you by the mailbox when it ends. Await the JoinHandle returned by the executor to retrieve this.

ThesErr

Errors that can happen in thespis_impl.

Constants

BOUNDED

Default buffer size for bounded channel between Addr and Mailbox.

Traits

CloneSink

Interface for T: Sink + Clone

SinkExt

An extension trait for Sinks that provides a variety of convenient combinator functions.

Type Definitions

BoxEnvelope

Shorthand for a Send boxed envelope.

ChanReceiver

Type of boxed channel receiver for Mailbox.

ChanSender

Type of boxed channel sender for Addr.

SinkError

A boxed error type for the sink

ThesRes

Result which has a ThesErr as error type.