DataKey

Trait DataKey 

Source
pub trait DataKey {
    type Value: Clone + Send + Sync + 'static;

    // Required methods
    async fn init();
    async fn on_change();
    async fn on_drop();
    fn try_read(    ) -> Option<ReadableRef<'static, Signal<Self::Value, SyncStorage>>>;
    fn try_peek(    ) -> Option<ReadableRef<'static, Signal<Self::Value, SyncStorage>>>;

    // Provided methods
    fn read() -> ReadableRef<'static, Signal<Self::Value, SyncStorage>> { ... }
    fn peek() -> ReadableRef<'static, Signal<Self::Value, SyncStorage>> { ... }
}

Required Associated Types§

Source

type Value: Clone + Send + Sync + 'static

Required Methods§

Source

async fn init()

CAUTION: since this runs in an use_resource BE CAUTIOUS OF CYCLES WHEN USING THE GLOBAL DATA SIGNAL.

Source

async fn on_change()

Source

async fn on_drop()

Source

fn try_read() -> Option<ReadableRef<'static, Signal<Self::Value, SyncStorage>>>

Source

fn try_peek() -> Option<ReadableRef<'static, Signal<Self::Value, SyncStorage>>>

Provided Methods§

Source

fn read() -> ReadableRef<'static, Signal<Self::Value, SyncStorage>>

Source

fn peek() -> ReadableRef<'static, Signal<Self::Value, SyncStorage>>

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§