[−][src]Struct anylog::LogEntry
Represents a parsed log entry.
Implementations
impl<'a> LogEntry<'a>
[src]
pub fn parse(bytes: &[u8]) -> LogEntry<'_>
[src]
Parses a well known log line into a log entry.
pub fn parse_with_local_timezone(
bytes: &[u8],
offset: Option<FixedOffset>
) -> LogEntry<'_>
[src]
bytes: &[u8],
offset: Option<FixedOffset>
) -> LogEntry<'_>
Similar to parse
but uses the given timezone for local time.
pub fn from_utc_time(ts: DateTime<Utc>, message: &'a [u8]) -> LogEntry<'a>
[src]
Constructs a log entry from a UTC timestamp and message.
pub fn from_local_time(ts: DateTime<Local>, message: &'a [u8]) -> LogEntry<'a>
[src]
Constructs a log entry from a local timestamp and message.
pub fn from_fixed_time(
ts: DateTime<FixedOffset>,
message: &'a [u8]
) -> LogEntry<'a>
[src]
ts: DateTime<FixedOffset>,
message: &'a [u8]
) -> LogEntry<'a>
Constructs a log entry from a timestamp in a specific timezone and message.
pub fn from_message_only(message: &'a [u8]) -> LogEntry<'a>
[src]
Creates a log entry from only a message.
pub fn local_timestamp(&self) -> Option<DateTime<Local>>
[src]
Returns the timestamp in local timezone.
pub fn utc_timestamp(&self) -> Option<DateTime<Utc>>
[src]
Returns the timestamp in UTC timezone.
pub fn message(&'a self) -> &str
[src]
Returns the message.
pub fn component_and_message(&'a self) -> (Option<&str>, &str)
[src]
Like message
but chops off a leading component.
Trait Implementations
Auto Trait Implementations
impl<'a> RefUnwindSafe for LogEntry<'a>
[src]
impl<'a> Send for LogEntry<'a>
[src]
impl<'a> Sync for LogEntry<'a>
[src]
impl<'a> Unpin for LogEntry<'a>
[src]
impl<'a> UnwindSafe for LogEntry<'a>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,