Trait RequestStateExt

Source
pub trait RequestStateExt {
    // Required methods
    fn get_state(&self, type_id: TypeId) -> Option<&Arc<dyn Any + Send + Sync>>;
    fn set_state_map(&mut self, state_map: StateMap);
    fn state_map(&self) -> Option<&StateMap>;
}
Expand description

Extension trait for Request to handle state

Required Methods§

Source

fn get_state(&self, type_id: TypeId) -> Option<&Arc<dyn Any + Send + Sync>>

Get state by TypeId

Source

fn set_state_map(&mut self, state_map: StateMap)

Set the state map for this request

Source

fn state_map(&self) -> Option<&StateMap>

Get a reference to the state map

Implementors§

Source§

impl RequestStateExt for Request

Implementation of RequestStateExt for Request