pub struct AuthenticationContext {
pub method: SmartString,
pub path: SmartString,
pub query_params: Option<Vec<(SmartString, SmartString)>>,
pub body: Option<SmartString>,
pub timestamp: Option<u64>,
pub metadata: Option<SmartString>,
}Expand description
Authentication context for a request
Fields§
§method: SmartStringHTTP method (GET, POST, PUT, DELETE)
path: SmartStringAPI path (e.g., “/api/v3/order”)
query_params: Option<Vec<(SmartString, SmartString)>>Query parameters
body: Option<SmartString>Request body (if any)
timestamp: Option<u64>Request timestamp (optional, will use current time if None)
metadata: Option<SmartString>Additional context-specific data
Implementations§
Source§impl AuthenticationContext
impl AuthenticationContext
Sourcepub fn new(method: impl Into<SmartString>, path: impl Into<SmartString>) -> Self
pub fn new(method: impl Into<SmartString>, path: impl Into<SmartString>) -> Self
Create a new authentication context
Sourcepub fn with_query_params(self, params: Vec<(SmartString, SmartString)>) -> Self
pub fn with_query_params(self, params: Vec<(SmartString, SmartString)>) -> Self
Set query parameters
Sourcepub const fn with_timestamp(self, timestamp: u64) -> Self
pub const fn with_timestamp(self, timestamp: u64) -> Self
Set timestamp
Sourcepub fn with_metadata(self, metadata: impl Into<SmartString>) -> Self
pub fn with_metadata(self, metadata: impl Into<SmartString>) -> Self
Set metadata
Trait Implementations§
Source§impl Clone for AuthenticationContext
impl Clone for AuthenticationContext
Source§fn clone(&self) -> AuthenticationContext
fn clone(&self) -> AuthenticationContext
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AuthenticationContext
impl RefUnwindSafe for AuthenticationContext
impl Send for AuthenticationContext
impl Sync for AuthenticationContext
impl Unpin for AuthenticationContext
impl UnwindSafe for AuthenticationContext
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