pub struct Link { /* fields omitted */ }
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
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Link
impl !UnwindSafe for Link
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
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