Struct cloudfront_logs::raw::SmartRawLogLineView

source ·
pub struct SmartRawLogLineView<'a> { /* private fields */ }
Expand description

View into a borrowed log line

Unlike RawLogLine, this struct does not compute all the fields upfront, but instead provides methods to access the fields on demand.

This can be useful when you need to access only one or two fields from a log line. Performance gets worse if you need to access many fields; cloning the iterator becomes more expensive compared to a pre-computed struct like RawLogLine.

Implementations§

source§

impl<'a> LogLineView<'a>

source

pub fn new(line: &'a str) -> Result<Self, &'static str>

Creates a new RawLogLineView from a borrowed log line

The line is checked for the correct number of fields and that it’s not a comment line (like the version or fields header).

source

pub fn date(&self) -> &'a str

Returns the date field of the log line

This is the fallible version, though it should never fail, as the line has been checked for the correct number of fields when the struct was initialised

source

pub fn time(&self) -> &'a str

source

pub fn x_edge_location(&self) -> &'a str

source

pub fn sc_bytes(&self) -> &'a str

source

pub fn c_ip(&self) -> &'a str

source

pub fn cs_method(&self) -> &'a str

source

pub fn cs_host(&self) -> &'a str

source

pub fn cs_uri_stem(&self) -> &'a str

source

pub fn sc_status(&self) -> &'a str

source

pub fn cs_referer(&self) -> &'a str

source

pub fn cs_user_agent(&self) -> &'a str

source

pub fn cs_uri_query(&self) -> &'a str

source

pub fn x_edge_result_type(&self) -> &'a str

source

pub fn x_edge_request_id(&self) -> &'a str

source

pub fn x_host_header(&self) -> &'a str

source

pub fn cs_protocol(&self) -> &'a str

source

pub fn cs_bytes(&self) -> &'a str

source

pub fn time_taken(&self) -> &'a str

source

pub fn x_forwarded_for(&self) -> &'a str

source

pub fn ssl_protocol(&self) -> &'a str

source

pub fn ssl_cipher(&self) -> &'a str

source

pub fn x_edge_response_result_type(&self) -> &'a str

source

pub fn cs_protocol_version(&self) -> &'a str

source

pub fn fle_status(&self) -> &'a str

source

pub fn fle_encrypted_fields(&self) -> &'a str

source

pub fn c_port(&self) -> &'a str

source

pub fn time_to_first_byte(&self) -> &'a str

source

pub fn x_edge_detailed_result_type(&self) -> &'a str

source

pub fn sc_content_type(&self) -> &'a str

source

pub fn sc_content_len(&self) -> &'a str

source

pub fn sc_range_start(&self) -> &'a str

source

pub fn sc_range_end(&self) -> &'a str

Trait Implementations§

source§

impl<'a> Debug for LogLineView<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !Freeze for LogLineView<'a>

§

impl<'a> !RefUnwindSafe for LogLineView<'a>

§

impl<'a> Send for LogLineView<'a>

§

impl<'a> !Sync for LogLineView<'a>

§

impl<'a> Unpin for LogLineView<'a>

§

impl<'a> UnwindSafe for LogLineView<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.