pub struct SessionMeta {
pub ip_address: String,
pub user_agent: String,
pub device_name: String,
pub device_type: String,
pub fingerprint: String,
}Expand description
Request metadata used to create sessions. Built by the middleware from request headers.
Fields§
§ip_address: StringClient IP address (respects trusted-proxy configuration).
user_agent: StringRaw User-Agent header value.
device_name: StringHuman-readable device name (e.g. "Chrome on macOS").
device_type: StringDevice category: "desktop", "mobile", or "tablet".
fingerprint: StringSHA-256 fingerprint used for hijack detection.
Implementations§
Source§impl SessionMeta
impl SessionMeta
Sourcepub fn from_headers(
ip_address: String,
user_agent: &str,
accept_language: &str,
accept_encoding: &str,
) -> Self
pub fn from_headers( ip_address: String, user_agent: &str, accept_language: &str, accept_encoding: &str, ) -> Self
Build SessionMeta from individual header values.
ip_address should already be the resolved client IP (use
extract_client_ip to obtain it from raw headers).
Trait Implementations§
Source§impl Clone for SessionMeta
impl Clone for SessionMeta
Source§fn clone(&self) -> SessionMeta
fn clone(&self) -> SessionMeta
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SessionMeta
impl RefUnwindSafe for SessionMeta
impl Send for SessionMeta
impl Sync for SessionMeta
impl Unpin for SessionMeta
impl UnsafeUnpin for SessionMeta
impl UnwindSafe for SessionMeta
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more