pub struct Record {
pub uid: Uuid,
/* private fields */
}Expand description
Represents a processed log record.
A Record consists of a TokenStream (the tokenized log line) and a
unique identifier (Uuid).
Fields§
§uid: UuidImplementations§
Source§impl Record
impl Record
Sourcepub fn calc_sim_score(&self, candidate: &Record) -> u64
pub fn calc_sim_score(&self, candidate: &Record) -> u64
Calculates a similarity score between this Record (acting as a template)
and a candidate Record.
The score is the number of matching tokens between the two records.
A Token::Wildcard in the template matches any token in the candidate.
§Arguments
candidate- TheRecordto compare against this record.
§Returns
The similarity score as a u64.
Sourcepub fn first(&self) -> Option<DefaultSymbol>
pub fn first(&self) -> Option<DefaultSymbol>
Returns the first token of the record’s TokenStream.
§Returns
An Option<DefaultSymbol> containing the first token if it exists, otherwise None.
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of tokens in the record’s TokenStream.
§Returns
The length of the token stream as a usize.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Checks if the record’s TokenStream is empty.
§Returns
true if the token stream is empty, false otherwise.
Sourcepub fn resolve(sym: DefaultSymbol) -> Option<String>
pub fn resolve(sym: DefaultSymbol) -> Option<String>
Resolves a DefaultSymbol back to its original string representation.
This is a utility method that uses the global string interner to retrieve the string associated with a given symbol.
§Arguments
sym- TheDefaultSymbolto resolve.
§Returns
An Option<String> containing the resolved string if the symbol exists,
otherwise None.
Trait Implementations§
Source§impl IntoIterator for Record
impl IntoIterator for Record
Source§impl<'a> IntoIterator for &'a Record
impl<'a> IntoIterator for &'a Record
Auto Trait Implementations§
impl Freeze for Record
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnsafeUnpin for Record
impl UnwindSafe for Record
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Joinable for Twhere
&'a T: for<'a> IntoIterator,
impl<T> Joinable for Twhere
&'a T: for<'a> IntoIterator,
type Collection = T
Source§fn join_concat(self) -> Join<Self::Collection, NoSeparator>
fn join_concat(self) -> Join<Self::Collection, NoSeparator>
Display, the underlying elements will be directly concatenated.
Note that the separator, while empty, is still present, and will show
up if you iterate this instance. Read more