pub struct ContentParticle {
pub term: ContentTerm,
pub min_occurs: u32,
pub max_occurs: Option<u32>,
pub source: Option<SourceRef>,
}Expand description
Content particle (term with occurrence constraints)
Fields§
§term: ContentTermThe term (element, group, wildcard)
min_occurs: u32Minimum occurrences (default 1)
max_occurs: Option<u32>Maximum occurrences (None = unbounded)
source: Option<SourceRef>Source location
Implementations§
Source§impl ContentParticle
impl ContentParticle
Sourcepub fn new(term: ContentTerm) -> Self
pub fn new(term: ContentTerm) -> Self
Create a particle with default occurrence (1..1)
Sourcepub fn with_occurs(term: ContentTerm, min: u32, max: Option<u32>) -> Self
pub fn with_occurs(term: ContentTerm, min: u32, max: Option<u32>) -> Self
Create a particle with custom occurrence
Sourcepub fn is_optional(&self) -> bool
pub fn is_optional(&self) -> bool
Check if this particle is optional (minOccurs=0)
Sourcepub fn is_repeating(&self) -> bool
pub fn is_repeating(&self) -> bool
Check if this particle allows multiple occurrences
Sourcepub fn is_unbounded(&self) -> bool
pub fn is_unbounded(&self) -> bool
Check if this particle is unbounded
Trait Implementations§
Source§impl Clone for ContentParticle
impl Clone for ContentParticle
Source§fn clone(&self) -> ContentParticle
fn clone(&self) -> ContentParticle
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 moreAuto Trait Implementations§
impl Freeze for ContentParticle
impl RefUnwindSafe for ContentParticle
impl Send for ContentParticle
impl Sync for ContentParticle
impl Unpin for ContentParticle
impl UnsafeUnpin for ContentParticle
impl UnwindSafe for ContentParticle
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