pub struct AccessLogEntry {
pub client_ip: String,
pub timestamp: SystemTime,
pub method: String,
pub path: String,
pub version: String,
pub status: u16,
pub size: usize,
pub duration_ms: u64,
pub user_agent: Option<String>,
pub referer: Option<String>,
}Expand description
Access log entry
Fields§
§client_ip: StringClient IP address
timestamp: SystemTimeRequest timestamp
method: StringHTTP method
path: StringRequest path
version: StringHTTP version
status: u16Response status code
size: usizeResponse size in bytes
duration_ms: u64Request duration in milliseconds
user_agent: Option<String>User-Agent header
referer: Option<String>Referer header
Implementations§
Source§impl AccessLogEntry
impl AccessLogEntry
Sourcepub fn new(
client_ip: impl Into<String>,
method: impl Into<String>,
path: impl Into<String>,
) -> Self
pub fn new( client_ip: impl Into<String>, method: impl Into<String>, path: impl Into<String>, ) -> Self
Create a new access log entry
Sourcepub fn with_version(self, version: impl Into<String>) -> Self
pub fn with_version(self, version: impl Into<String>) -> Self
Set HTTP version
Sourcepub fn with_status(self, status: u16) -> Self
pub fn with_status(self, status: u16) -> Self
Set response status
Sourcepub fn with_duration_ms(self, duration_ms: u64) -> Self
pub fn with_duration_ms(self, duration_ms: u64) -> Self
Set request duration
Sourcepub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
pub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
Set User-Agent
Sourcepub fn with_referer(self, referer: impl Into<String>) -> Self
pub fn with_referer(self, referer: impl Into<String>) -> Self
Set Referer
Trait Implementations§
Source§impl Clone for AccessLogEntry
impl Clone for AccessLogEntry
Source§fn clone(&self) -> AccessLogEntry
fn clone(&self) -> AccessLogEntry
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 AccessLogEntry
impl RefUnwindSafe for AccessLogEntry
impl Send for AccessLogEntry
impl Sync for AccessLogEntry
impl Unpin for AccessLogEntry
impl UnsafeUnpin for AccessLogEntry
impl UnwindSafe for AccessLogEntry
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