Struct usiem::events::schema::FieldSchema
source · pub struct FieldSchema {
pub fields: BTreeMap<&'static str, FieldType>,
pub allow_unknown_fields: bool,
pub gdpr: Option<GdprProtection>,
}
Expand description
Data schema that allows indexation of logs with field filtering
Fields
fields: BTreeMap<&'static str, FieldType>
allow_unknown_fields: bool
When used in table based ddbb, create an extra column to store the rest of the fields. Maybe a JSON file
gdpr: Option<GdprProtection>
GDPR protection of fields
Implementations
sourceimpl FieldSchema
impl FieldSchema
pub fn new() -> FieldSchema
pub fn add_schema(&mut self, schema: &FieldSchema)
pub fn insert(&mut self, key: &'static str, value: FieldType) -> Option<FieldType>
pub fn set_gdpr(&mut self, protection: Option<GdprProtection>)
pub fn protected_field(&self, field: &str) -> bool
pub fn get_field(&self, field: &str) -> Option<&FieldType>
pub fn field_names(&self) -> Vec<String>
sourcepub fn filter_fields(&mut self, fields: &BTreeSet<&'static str>)
pub fn filter_fields(&mut self, fields: &BTreeSet<&'static str>)
Remove fields from the schema
Trait Implementations
sourceimpl Clone for FieldSchema
impl Clone for FieldSchema
sourcefn clone(&self) -> FieldSchema
fn clone(&self) -> FieldSchema
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for FieldSchema
impl Debug for FieldSchema
sourceimpl Serialize for FieldSchema
impl Serialize for FieldSchema
Auto Trait Implementations
impl RefUnwindSafe for FieldSchema
impl Send for FieldSchema
impl Sync for FieldSchema
impl Unpin for FieldSchema
impl UnwindSafe for FieldSchema
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more