pub struct Occurrence {
pub min: u32,
pub max: Option<u32>,
}Expand description
Particle occurrence constraints
Fields§
§min: u32Minimum occurrences
max: Option<u32>Maximum occurrences (None = unbounded)
Implementations§
Source§impl Occurrence
impl Occurrence
Sourcepub const ONCE: Occurrence
pub const ONCE: Occurrence
Default occurrence (1..1)
Sourcepub const OPTIONAL: Occurrence
pub const OPTIONAL: Occurrence
Optional occurrence (0..1)
Sourcepub const UNBOUNDED: Occurrence
pub const UNBOUNDED: Occurrence
Unbounded occurrence (0..unbounded)
Sourcepub const ONE_OR_MORE: Occurrence
pub const ONE_OR_MORE: Occurrence
Required with unbounded max (1..unbounded)
Sourcepub fn is_optional(&self) -> bool
pub fn is_optional(&self) -> bool
Check if this occurrence is optional
Sourcepub fn is_unbounded(&self) -> bool
pub fn is_unbounded(&self) -> bool
Check if this occurrence is unbounded
Sourcepub fn allows_multiple(&self) -> bool
pub fn allows_multiple(&self) -> bool
Check if this occurrence allows multiple
Trait Implementations§
Source§impl Clone for Occurrence
impl Clone for Occurrence
Source§fn clone(&self) -> Occurrence
fn clone(&self) -> Occurrence
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 Copy for Occurrence
Source§impl Debug for Occurrence
impl Debug for Occurrence
Source§impl Default for Occurrence
impl Default for Occurrence
impl Eq for Occurrence
Source§impl PartialEq for Occurrence
impl PartialEq for Occurrence
Source§fn eq(&self, other: &Occurrence) -> bool
fn eq(&self, other: &Occurrence) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Occurrence
Auto Trait Implementations§
impl Freeze for Occurrence
impl RefUnwindSafe for Occurrence
impl Send for Occurrence
impl Sync for Occurrence
impl Unpin for Occurrence
impl UnsafeUnpin for Occurrence
impl UnwindSafe for Occurrence
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