pub struct Link { /* private fields */ }
Expand description

A link to another unit.

The link allows tracking of updates of that other unit. This happens via the query method. A link’s owner can signal that they are currently not interested in receiving updates via the suspend method. This suspension will automatically be lifted the next time query is called.

Links can be created from the name of the unit they should be linking to via manager::load_link. This function is also called implicitly through the impls for Deserialize and From. Note, however, that the function only adds the link to a list of links to be properly connected by the manager later.

Implementations

Query for the next update.

The method returns a future that resolves into the next update. The future can be dropped safely at any time.

The future either resolves into a payload update or the connected unit’s new status as the error variant. The current status is also available via the get_status method.

If the link is currently suspended, calling this method will lift the suspension.

Query a suspended link.

When a link is suspended, it still received updates to the unit’s status. These updates can also be queried for explicitly via this method.

Much like query, the future returned by this method can safely be dropped at any time.

Suspends the link.

A suspended link will not receive any payload updates from the connected unit. It will, however, still receive status updates.

The suspension is lifted automatically the next time query is called.

Note that this is an async method that needs to be awaited in order to do anything.

Returns the current status of the connected unit.

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Converts to this type from the input type.

Converts to this type from the input type.

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

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

Calls U::from(self).

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

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