[][src]Struct wd_event::context::Context

pub struct Context { /* fields omitted */ }

Implementations

impl Context[src]

pub fn new_null() -> Self[src]

pub fn new_add_msg<V: Any>(msg: V) -> Self[src]

pub fn new_delay(t: Duration, cycle: bool) -> Self[src]

pub fn get_msg<T: 'static>(&self) -> Option<Arc<T>>[src]

pub fn get_delay(&self) -> Duration[src]

pub fn set_value<K: ToString, V: Any>(&self, key: K, value: V)[src]

pub fn get_value_raw<K: ToString>(&self, key: &K) -> Option<Arc<dyn Any>>[src]

pub fn get_value<K: ToString, T: Clone + 'static>(&self, key: &K) -> Option<T>[src]

获取指定类型的数据,该类型需要实现Clone

let value:&str = match ctx.get_value("haha"){
    Some(s)=>{s}
    None=>{"haha"}
};

pub fn get_arc_value<K: ToString, T: 'static>(&self, key: &K) -> Option<Arc<T>>[src]

pub fn set_status(&self, status: bool)[src]

在顺序执行的事件中,如果检测到状态失败,则不再执行后续回调

pub fn get_status(&self) -> bool[src]

Trait Implementations

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.