[][src]Struct romp::workflow::context::Context

pub struct Context {
    pub session: Arc<RwLock<StompSession>>,
    pub attributes: HashMap<&'static str, String>,
    pub is_secure: bool,
    pub is_web_sockets: bool,
    // some fields omitted
}

Fields

session: Arc<RwLock<StompSession>>

StompSession is valid for the duration of a STOMP TCP connection or WebSocket

attributes: HashMap<&'static str, String>

Request attributes, valid for the life of a single message, to avoid collisions prefix the attributes with the cargo project name e.g. "romp."

is_secure: boolis_web_sockets: bool

flag is true if incoming request has upgraded to WebSockets

Methods

impl Context[src]

pub fn mock() -> Context[src]

pub fn now(&mut self) -> DateTime<Utc>[src]

returns (cached) timestamp

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

returns (cached) admin flag from the session

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

returns (cached) downstream flag from the session

Auto Trait Implementations

impl RefUnwindSafe for Context

impl Send for Context

impl Sync for Context

impl Unpin for Context

impl UnwindSafe for Context

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> Erased for T

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

impl<T> UnsafeAny for T where
    T: Any