pub trait Event: Sized {
type Encoding: Encoding;
// Required methods
fn visit_event<'a>(
&'a mut self,
visitor: &mut impl EventVisitor<'a>,
) -> Result<(), ScannerError>;
fn visit_string_mut(
&mut self,
path: &Path<'_>,
visit: impl FnOnce(&mut String) -> bool,
);
// Provided method
fn get_id(&self) -> Option<&str> { ... }
}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>,
) -> Result<(), ScannerError>
fn visit_event<'a>( &'a mut self, visitor: &mut impl EventVisitor<'a>, ) -> Result<(), ScannerError>
Recursively visit all strings contained in the object.
Sourcefn visit_string_mut(
&mut self,
path: &Path<'_>,
visit: impl FnOnce(&mut String) -> bool,
)
fn visit_string_mut( &mut self, path: &Path<'_>, visit: impl FnOnce(&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.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".