#[non_exhaustive]pub struct RecordLimits {
pub groups: Limit,
pub field_bytes: Limit,
pub email_bytes: Limit,
pub display_name_bytes: Limit,
}Expand description
How large a record’s fields may be, each a [Limit] the caller can change or lift.
By default at most 256 groups, 256 bytes in an id, a name or a group, 320 in an email
address and 1 024 in a display name. They bound memory and what a log line can carry, not
trust. Every field is also refused when empty or holding a control character
(check_field).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.groups: LimitGroups one record holds.
field_bytes: LimitBytes in an id, a name or a group.
email_bytes: LimitBytes in an email address.
display_name_bytes: LimitBytes in a display name.
Implementations§
Source§impl RecordLimits
impl RecordLimits
Sourcepub const DEFAULT: Self
pub const DEFAULT: Self
The defaults: 256 groups, 256-byte fields, 320-byte email addresses, 1 024-byte display names.
Sourcepub const fn field_bytes(self, bytes: Limit) -> Self
pub const fn field_bytes(self, bytes: Limit) -> Self
These limits with field_bytes.
Sourcepub const fn email_bytes(self, bytes: Limit) -> Self
pub const fn email_bytes(self, bytes: Limit) -> Self
These limits with email_bytes.
Sourcepub const fn display_name_bytes(self, bytes: Limit) -> Self
pub const fn display_name_bytes(self, bytes: Limit) -> Self
These limits with display_name_bytes.
Sourcepub fn allows_field(&self, value: &str) -> bool
pub fn allows_field(&self, value: &str) -> bool
Whether value may be an id, a name or a group.
Sourcepub fn allows_groups(&self, groups: &[String]) -> bool
pub fn allows_groups(&self, groups: &[String]) -> bool
Whether a record may hold these groups: not too many, each a field.
Sourcepub fn allows_email(&self, value: &str) -> bool
pub fn allows_email(&self, value: &str) -> bool
Whether value may be an email address.
Sourcepub fn allows_display_name(&self, value: &str) -> bool
pub fn allows_display_name(&self, value: &str) -> bool
Whether value may be a display name.
Trait Implementations§
Source§impl Clone for RecordLimits
impl Clone for RecordLimits
impl Copy for RecordLimits
Source§impl Debug for RecordLimits
impl Debug for RecordLimits
Source§impl Default for RecordLimits
impl Default for RecordLimits
Source§impl Describe for RecordLimits
impl Describe for RecordLimits
impl Eq for RecordLimits
impl Fields for RecordLimits
Source§impl Inspect for RecordLimits
impl Inspect for RecordLimits
Source§impl PartialEq for RecordLimits
impl PartialEq for RecordLimits
impl StructuralPartialEq for RecordLimits
Auto Trait Implementations§
impl Freeze for RecordLimits
impl RefUnwindSafe for RecordLimits
impl Send for RecordLimits
impl Sync for RecordLimits
impl Unpin for RecordLimits
impl UnsafeUnpin for RecordLimits
impl UnwindSafe for RecordLimits
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.