Struct eventuals::Ptr [−][src]
#[repr(transparent)]pub struct Ptr<T> { /* fields omitted */ }
Expand description
This type is a thin wrapper around T to enable cheap clone and comparisons. Internally it is an Arc that is compared by address instead of by the implementation of the pointed to value.
Additionally, Ptr implements Error where T: Error. This makes working with TryEventuals easier since many error types do not impl Value, but when wrapped in Ptr do.
One thing to be aware of is that because values are compared by address subscribers may be triggered unnecessarily in some contexts. If this is undesirable use Arc instead.
This type is not specifically Eventual related, but is a useful pattern.
Implementations
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Ptr<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Ptr<T> where
T: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more