pub struct LogTextPresenter<'a> { /* private fields */ }
Expand description
Used to control stringification options of Data
Implementations§
Source§impl<'a> LogTextPresenter<'a>
impl<'a> LogTextPresenter<'a>
Sourcepub fn new(log: &'a Data<Logs>, options: LogTextDisplayOptions) -> Self
pub fn new(log: &'a Data<Logs>, options: LogTextDisplayOptions) -> Self
Creates a new LogTextPresenter with the specified options and log message. This presenter is bound to the lifetime of the underlying log message.
Methods from Deref<Target = Data<Logs>>§
Sourcepub fn msg(&self) -> Option<&str>
pub fn msg(&self) -> Option<&str>
Returns the string log associated with the message, if one exists.
Sourcepub fn payload_message(&self) -> Option<&DiagnosticsHierarchy<LogsField>>
pub fn payload_message(&self) -> Option<&DiagnosticsHierarchy<LogsField>>
If the log has message, returns an exclusive reference to it.
Sourcepub fn payload_keys(&self) -> Option<&DiagnosticsHierarchy<LogsField>>
pub fn payload_keys(&self) -> Option<&DiagnosticsHierarchy<LogsField>>
If the log has structured keys, returns an exclusive reference to them.
pub fn metadata(&self) -> &LogsMetadata
Sourcepub fn payload_keys_strings(&self) -> Box<dyn Iterator<Item = String> + '_>
pub fn payload_keys_strings(&self) -> Box<dyn Iterator<Item = String> + '_>
Returns an iterator over the payload keys as strings with the format “key=value”.
Sourcepub fn file_path(&self) -> Option<&str>
pub fn file_path(&self) -> Option<&str>
Returns the file path associated with the message, if one exists.
Sourcepub fn line_number(&self) -> Option<&u64>
pub fn line_number(&self) -> Option<&u64>
Returns the line number associated with the message, if one exists.
Returns the tags associated with the message, if any exist.
Sourcepub fn dropped_logs(&self) -> Option<u64>
pub fn dropped_logs(&self) -> Option<u64>
Returns number of dropped logs if reported in the message.
Sourcepub fn rolled_out_logs(&self) -> Option<u64>
pub fn rolled_out_logs(&self) -> Option<u64>
Returns number of rolled out logs if reported in the message.
Sourcepub fn component_name(&self) -> Cow<'_, str>
pub fn component_name(&self) -> Cow<'_, str>
Returns the component name. This only makes sense for v1 components.
Trait Implementations§
Source§impl Deref for LogTextPresenter<'_>
impl Deref for LogTextPresenter<'_>
Auto Trait Implementations§
impl<'a> Freeze for LogTextPresenter<'a>
impl<'a> RefUnwindSafe for LogTextPresenter<'a>
impl<'a> Send for LogTextPresenter<'a>
impl<'a> Sync for LogTextPresenter<'a>
impl<'a> Unpin for LogTextPresenter<'a>
impl<'a> UnwindSafe for LogTextPresenter<'a>
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
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 more