[][src]Struct anylog::LogEntry

pub struct LogEntry<'a> { /* fields omitted */ }

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]

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]

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

impl<'a> Debug for LogEntry<'a>[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.