Skip to main content

OptionHandle

Trait OptionHandle 

Source
pub trait OptionHandle<T>
where T: Clone + Send + Sync + 'static,
{ // Required methods async fn is_some(&self) -> bool; async fn is_none(&self) -> bool; }
Expand description

An implementation of the ActorOption extension trait for the standard Option. This extension trait is made available on the Handle through the actify macro as OptionHandle. Within the actor these methods are invoked, which in turn just extend the functionality provided by the std library.

Required Methods§

Source

async fn is_some(&self) -> bool

Returns true if the option is a Some value.

§Examples
let handle = Handle::new(Some(1));
assert!(handle.is_some().await);
Source

async fn is_none(&self) -> bool

Returns true if the option is a None value.

§Examples
let handle = Handle::new(Option::<i32>::None);
assert!(handle.is_none().await);

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T, __V> OptionHandle<T> for Handle<Option<T>, __V>
where T: Clone + Send + Sync + 'static,

An implementation of the ActorOption extension trait for the standard Option. This extension trait is made available on the Handle through the actify macro as OptionHandle. Within the actor these methods are invoked, which in turn just extend the functionality provided by the std library.