pub struct RedactingSerializer<'a> { /* private fields */ }Expand description
CanonicalJsonObject serializer that redacts fields on the fly.
The main use case for this is to compute the hashes or signatures of an event, where the event needs to be redacted and have a few other fields removed.
This avoids having to .clone() a CanonicalJsonObject, and then to
redact() it and potentially remove other fields, and serialize it with
serde_json::to_vec().
Implementations§
Source§impl<'a> RedactingSerializer<'a>
impl<'a> RedactingSerializer<'a>
Sourcepub fn rules(self, rules: &'a RedactionRules) -> Self
pub fn rules(self, rules: &'a RedactionRules) -> Self
Add the redaction rules to apply.
If this is set, the object to serialize must be an event with a type field.
Sourcepub fn custom_redacted_root_fields(self, fields: &'a [&'a str]) -> Self
pub fn custom_redacted_root_fields(self, fields: &'a [&'a str]) -> Self
Add custom fields to redact at the root of the object.
Trait Implementations§
Source§impl<'a> Clone for RedactingSerializer<'a>
impl<'a> Clone for RedactingSerializer<'a>
Source§fn clone(&self) -> RedactingSerializer<'a>
fn clone(&self) -> RedactingSerializer<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for RedactingSerializer<'a>
Source§impl<'a> Debug for RedactingSerializer<'a>
impl<'a> Debug for RedactingSerializer<'a>
Source§impl<'a> Default for RedactingSerializer<'a>
impl<'a> Default for RedactingSerializer<'a>
Source§fn default() -> RedactingSerializer<'a>
fn default() -> RedactingSerializer<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for RedactingSerializer<'a>
impl<'a> RefUnwindSafe for RedactingSerializer<'a>
impl<'a> Send for RedactingSerializer<'a>
impl<'a> Sync for RedactingSerializer<'a>
impl<'a> Unpin for RedactingSerializer<'a>
impl<'a> UnsafeUnpin for RedactingSerializer<'a>
impl<'a> UnwindSafe for RedactingSerializer<'a>
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