Skip to main content

UseStateTarget

Trait UseStateTarget 

Source
pub trait UseStateTarget<T, Tag>: UseStateConvTarget<T, T, Tag>
where Self: 'static, T: 'static + Clone + Debug + PartialEq + Send + Sync, Tag: 'static + Clone + Debug + Eq + Hash + Send + Sync,
{ // Provided method fn subscribe<'async_trait>( self: Arc<Self>, reader: Reader<T>, tag: Tag, ) -> Pin<Box<dyn Future<Output = Handle<T>> + Send + 'async_trait>> where Self: Sync + Send + 'async_trait { ... } }
Expand description

Convenient method to do subscription. The trait is auto implemented for types implemented HasStateHandle.

Provided Methods§

Source

fn subscribe<'async_trait>( self: Arc<Self>, reader: Reader<T>, tag: Tag, ) -> Pin<Box<dyn Future<Output = Handle<T>> + Send + 'async_trait>>
where Self: Sync + Send + 'async_trait,

Do subscription.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<V, T, Tag> UseStateTarget<T, Tag> for V
where V: 'static + UseStateConvTarget<T, T, Tag>, T: 'static + Clone + Debug + PartialEq + Send + Sync, Tag: 'static + Clone + Debug + Eq + Hash + Send + Sync,