Trait OptionHandle

Source
pub trait OptionHandle<T>
where T: Clone + Debug + 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 for the standard Option. This extension trait is made available on the handle through the actify macro. Within the actor these methods are invoken, which in turn just extend the functionality provides 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_eq!(handle.is_some().await.unwrap(), true);
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.unwrap());

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> OptionHandle<T> for Handle<Option<T>>
where T: Clone + Debug + Send + Sync + 'static,