pub struct FlowRequest {
pub method: String,
pub path: String,
pub params: BTreeMap<String, String>,
pub query: BTreeMap<String, String>,
pub headers: BTreeMap<String, String>,
pub extensions: BTreeMap<String, Value>,
pub cache_control: BTreeMap<String, String>,
}Expand description
Request context for a single HTTP request in Resuma Flow / server actions.
Fields§
§method: String§path: String§params: BTreeMap<String, String>§query: BTreeMap<String, String>§headers: BTreeMap<String, String>§extensions: BTreeMap<String, Value>Arbitrary middleware / handler metadata attached during the request.
cache_control: BTreeMap<String, String>Per-loader HTTP cache hints (Cache-Control values).
Implementations§
Source§impl FlowRequest
impl FlowRequest
pub fn param(&self, key: &str) -> Option<&str>
pub fn query_param(&self, key: &str) -> Option<&str>
pub fn header(&self, key: &str) -> Option<&str>
pub fn set_extension(&mut self, key: impl Into<String>, value: Value)
pub fn extension(&self, key: &str) -> Option<&Value>
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
True when middleware attached extensions["authenticated"] = true.
Sourcepub fn roles(&self) -> Vec<String>
pub fn roles(&self) -> Vec<String>
Role names set by auth middleware (extensions["roles"] as JSON array).
pub fn has_role(&self, role: &str) -> bool
Trait Implementations§
Source§impl Clone for FlowRequest
impl Clone for FlowRequest
Source§fn clone(&self) -> FlowRequest
fn clone(&self) -> FlowRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FlowRequest
impl Debug for FlowRequest
Source§impl Default for FlowRequest
impl Default for FlowRequest
Source§fn default() -> FlowRequest
fn default() -> FlowRequest
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for FlowRequest
impl<'de> Deserialize<'de> for FlowRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FlowRequest
impl RefUnwindSafe for FlowRequest
impl Send for FlowRequest
impl Sync for FlowRequest
impl Unpin for FlowRequest
impl UnsafeUnpin for FlowRequest
impl UnwindSafe for FlowRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more