pub enum SimpleEvent {
String(String),
List(Vec<SimpleEvent>),
Map(BTreeMap<String, SimpleEvent>),
}
Expand description
A simple implementation of Event
. This is meant for testing / demonstration purposes.
It always start visiting elements with key == “message” first, then the rest of the keys in the map
Variants§
Implementations§
Source§impl SimpleEvent
impl SimpleEvent
Sourcepub fn as_list_mut(&mut self) -> Option<&mut Vec<SimpleEvent>>
pub fn as_list_mut(&mut self) -> Option<&mut Vec<SimpleEvent>>
Gets a mutable reference to the list.
Sourcepub fn as_map_mut(&mut self) -> Option<&mut BTreeMap<String, SimpleEvent>>
pub fn as_map_mut(&mut self) -> Option<&mut BTreeMap<String, SimpleEvent>>
Gets a mutable reference to the map.
Sourcepub fn as_string_mut(&mut self) -> Option<&mut String>
pub fn as_string_mut(&mut self) -> Option<&mut String>
Gets a mutable reference to the map.
Trait Implementations§
Source§impl Clone for SimpleEvent
impl Clone for SimpleEvent
Source§fn clone(&self) -> SimpleEvent
fn clone(&self) -> SimpleEvent
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SimpleEvent
impl Debug for SimpleEvent
Source§impl Event for SimpleEvent
impl Event for SimpleEvent
Source§type Encoding = Utf8Encoding
type Encoding = Utf8Encoding
The encoding used to calculate match indices. The actual data itself must always be UTF-8.
Source§fn visit_event<'path>(&'path mut self, visitor: &mut impl EventVisitor<'path>)
fn visit_event<'path>(&'path mut self, visitor: &mut impl EventVisitor<'path>)
Recursively visit all strings contained in the object.
Source§fn visit_string_mut(
&mut self,
path: &Path<'_>,
visit: impl FnMut(&mut String) -> bool,
)
fn visit_string_mut( &mut self, path: &Path<'_>, visit: impl FnMut(&mut String) -> bool, )
Visit the string at the specified path. The path is guaranteed to be valid, it will be a path
that was previously used in
visit_event'. This is used to replace redacted content.
visit` returns a bool indicating if the string was mutated.Source§impl PartialEq for SimpleEvent
impl PartialEq for SimpleEvent
impl Eq for SimpleEvent
impl StructuralPartialEq for SimpleEvent
Auto Trait Implementations§
impl Freeze for SimpleEvent
impl RefUnwindSafe for SimpleEvent
impl Send for SimpleEvent
impl Sync for SimpleEvent
impl Unpin for SimpleEvent
impl UnwindSafe for SimpleEvent
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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