pub struct Addr<A: Actor> { /* private fields */ }
Expand description

Reference implementation of thespis::Address<M>. It can be used to send all message types the actor implements thespis::Handler for.

When all Addr to a mailbox are dropped, the mailbox will end. There is also a WeakAddr that will not keep the actor alive.

Implementations

Produces a builder for convenient creation of both Addr and Mailbox.

Create a new WeakAddr. This is an address that does not keep the mailbox alive.

Information about the actor: id, name, typename and a span for tracing.

Trait Implementations

Call an actor and receive the result of the call. This is a two-way operation. Calling with a message type that has Return=() will notify you that the message has been handled by the receiver. Read more

Get a clone of this address as a Box<Address<M>>.

Upcast &self to &dyn Address.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Get the id of the mailbox this address sends to. There will be exactly one for each actor, so you can use this for uniquely identifying your actors.

This is an atomic usize that is incremented for every new mailbox. There currently is no overflow protection.

A human readable name of the actor.

Verify whether 2 Receivers will deliver to the same actor.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This is a no-op. The address can only really close when dropped. Close has no meaning before that.

The type of value produced by the sink when an error occurs.

Attempts to prepare the Sink to receive a value. Read more

Begin the process of sending a value to the sink. Each call to this function must be preceded by a successful call to poll_ready which returned Poll::Ready(Ok(())). Read more

Flush any remaining output from this sink. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Clone this sink.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Composes a function in front of the sink. Read more

Composes a function in front of the sink. Read more

Transforms the error returned by the sink.

Map this sink’s error to a different error type using the Into trait. Read more

Adds a fixed-size buffer to the current sink. Read more

Close the sink.

Fanout items to multiple sinks. Read more

Flush the sink, processing all pending items. Read more

A future that completes after the given item has been fully processed into the sink, including flushing. Read more

A future that completes after the given item has been received by the sink. Read more

A future that completes after the given stream has been fully processed into the sink, including flushing. Read more

Wrap this sink in an Either sink, making it the left-hand variant of that Either. Read more

Wrap this stream in an Either stream, making it the right-hand variant of that Either. Read more

Wraps a [Sink] into a sink compatible with libraries using futures 0.1 Sink. Requires the compat feature to be enabled. Read more

A convenience method for calling [Sink::poll_ready] on Unpin sink types. Read more

A convenience method for calling [Sink::start_send] on Unpin sink types. Read more

A convenience method for calling [Sink::poll_flush] on Unpin sink types. Read more

A convenience method for calling [Sink::poll_close] on Unpin sink types. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more