pub struct Limit(/* private fields */);Expand description
At most a count, or no bound at all.
Libraries here state their resource bounds (entries, rules, bytes) as Limits with a
default the caller can change or lift. As configuration it is a number, or none for no
bound. A document’s null is a key that is not given, so it reads the default, not “no
bound”.
use coqui_access::Limit;
assert!(Limit::at(2).allows(2) && !Limit::at(2).allows(3));
assert!(Limit::UNBOUNDED.allows(usize::MAX));Implementations§
Trait Implementations§
impl Copy for Limit
impl Eq for Limit
Source§impl Leaf for Limit
The text of a limit is its count, or none; Display stays the human wording.
impl Leaf for Limit
The text of a limit is its count, or none; Display stays the human wording.
§fn same(a: &Self, b: &Self) -> bool
fn same(a: &Self, b: &Self) -> bool
Whether two values are the same setting. Settings are compared after both texts are
parsed into this type, never as the raw input: by default the canonical texts of the two
values are equal, which the round-trip contract makes the type’s own equality. A type
whose equal values can write different texts (
-0.0 and 0.0) overrides it.impl StructuralPartialEq for Limit
Auto Trait Implementations§
impl Freeze for Limit
impl RefUnwindSafe for Limit
impl Send for Limit
impl Sync for Limit
impl Unpin for Limit
impl UnsafeUnpin for Limit
impl UnwindSafe for Limit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Describe for Twhere
T: Leaf,
impl<T> Describe for Twhere
T: Leaf,
§const LEAF: bool = true
const LEAF: bool = true
The type is one text: a [
Leaf], or an untagged enum whose arms all are. An untagged
enum counts the arms that are not, and holds at most one.§fn description() -> Description
fn description() -> Description
What this type is.