relay_event_schema::processor

Struct FieldAttrs

source
pub struct FieldAttrs {
    pub name: Option<&'static str>,
    pub required: bool,
    pub nonempty: bool,
    pub trim_whitespace: bool,
    pub characters: Option<CharacterSet>,
    pub max_chars: Option<usize>,
    pub max_chars_allowance: usize,
    pub max_depth: Option<usize>,
    pub max_bytes: Option<usize>,
    pub pii: Pii,
    pub retain: bool,
    pub trim: bool,
}
Expand description

Meta information about a field.

Fields§

§name: Option<&'static str>

Optionally the name of the field.

§required: bool

If the field is required.

§nonempty: bool

If the field should be non-empty.

§trim_whitespace: bool

Whether to trim whitespace from this string.

§characters: Option<CharacterSet>

A set of allowed or denied character ranges for this string.

§max_chars: Option<usize>

The maximum char length of this field.

§max_chars_allowance: usize

The extra char length allowance on top of max_chars.

§max_depth: Option<usize>

The maximum depth of this field.

§max_bytes: Option<usize>

The maximum number of bytes of this field.

§pii: Pii

The type of PII on the field.

§retain: bool

Whether additional properties should be retained during normalization.

§trim: bool

Whether the trimming processor is allowed to shorten or drop this field.

Implementations§

source§

impl FieldAttrs

source

pub const fn new() -> Self

Creates default FieldAttrs.

source

pub const fn required(self, required: bool) -> Self

Sets whether a value in this field is required.

source

pub const fn nonempty(self, nonempty: bool) -> Self

Sets whether this field can have an empty value.

This is distinct from required. An empty string ("") passes the “required” check but not the “nonempty” one.

source

pub const fn trim_whitespace(self, trim_whitespace: bool) -> Self

Sets whether whitespace should be trimmed before validation.

source

pub const fn pii(self, pii: Pii) -> Self

Sets whether this field contains PII.

source

pub const fn max_chars(self, max_chars: usize) -> Self

Sets the maximum number of characters allowed in the field.

source

pub const fn retain(self, retain: bool) -> Self

Sets whether additional properties should be retained during normalization.

Trait Implementations§

source§

impl Clone for FieldAttrs

source§

fn clone(&self) -> FieldAttrs

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FieldAttrs

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for FieldAttrs

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Copy for FieldAttrs

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T