pub struct Normalizer { /* private fields */ }Expand description
A source definition, checked and compiled.
Built once, then used for every record of the source. Normalizing is deterministic: the same bytes under the same definition version always give the same outcome.
Implementations§
Source§impl Normalizer
impl Normalizer
Sourcepub fn from_yaml(text: &str) -> Result<Self, DefinitionError>
pub fn from_yaml(text: &str) -> Result<Self, DefinitionError>
Loads a source definition from YAML, as untrusted input.
§Errors
Returns DefinitionError if the YAML is not a valid definition.
Sourcepub fn new(definition: &SourceDefinition) -> Result<Self, DefinitionError>
pub fn new(definition: &SourceDefinition) -> Result<Self, DefinitionError>
Checks and compiles a source definition.
§Errors
Returns DefinitionError if a path does not parse, two fields
would write over each other, a field writes an attribute that is set
otherwise, or a kind would accept every record; and if a class,
activity, or target is not in the OCSF schema, or a field writes a
value its attribute cannot hold.
Trait Implementations§
Source§impl Clone for Normalizer
impl Clone for Normalizer
Auto Trait Implementations§
impl Freeze for Normalizer
impl RefUnwindSafe for Normalizer
impl Send for Normalizer
impl Sync for Normalizer
impl Unpin for Normalizer
impl UnsafeUnpin for Normalizer
impl UnwindSafe for Normalizer
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