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>
impl<'a> LogLineView<'a>
sourcepub fn new(line: &'a str) -> Result<Self, &'static str>
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).
sourcepub fn date(&self) -> &'a str
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