pub trait Event: Sized {
type Encoding: Encoding;
// Required methods
fn visit_event<'a>(&'a mut self, visitor: &mut impl EventVisitor<'a>);
fn visit_string_mut(
&mut self,
path: &Path<'_>,
visit: impl FnMut(&mut String) -> bool,
);
}
Expand description
Any object that can be scanned by SDS needs to implement Event
.
You can think of an Event as a “JSON-like” object that has a nested map of values with String
keys.
Required Associated Types§
Required Methods§
Sourcefn visit_event<'a>(&'a mut self, visitor: &mut impl EventVisitor<'a>)
fn visit_event<'a>(&'a mut self, visitor: &mut impl EventVisitor<'a>)
Recursively visit all strings contained in the object.
Sourcefn 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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.