pub struct Cardinality {
pub required: bool,
pub repeats: bool,
}Expand description
How many times a field may appear, and whether it has to.
A dictionary generated from XML Schema knows a field’s minOccurs and
maxOccurs as well as its data type, and both change what a conversion
should emit: a required field is written even when the message leaves it
empty, so the position stays visible, and a field that cannot repeat
keeps its repetition separator as ordinary text rather than being split
into several elements. Hand-written dictionaries usually say nothing
about either, and then both default to false — see spec/index.md §3.2.
Fields§
§required: boolThe schema requires this field to be present.
repeats: boolThe schema lets this field appear more than once.
Trait Implementations§
Source§impl Clone for Cardinality
impl Clone for Cardinality
Source§fn clone(&self) -> Cardinality
fn clone(&self) -> Cardinality
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 Cardinality
Source§impl Debug for Cardinality
impl Debug for Cardinality
Source§impl Default for Cardinality
impl Default for Cardinality
Source§fn default() -> Cardinality
fn default() -> Cardinality
Returns the “default value” for a type. Read more
impl Eq for Cardinality
Source§impl PartialEq for Cardinality
impl PartialEq for Cardinality
impl StructuralPartialEq for Cardinality
Auto Trait Implementations§
impl Freeze for Cardinality
impl RefUnwindSafe for Cardinality
impl Send for Cardinality
impl Sync for Cardinality
impl Unpin for Cardinality
impl UnsafeUnpin for Cardinality
impl UnwindSafe for Cardinality
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