Struct sdml_core::model::Cardinality
source · pub struct Cardinality { /* private fields */ }
Expand description
Corresponds to the grammar rule cardinality
.
Implementations§
source§impl Cardinality
impl Cardinality
pub const fn new_range(min: u32, max: u32) -> Self
pub const fn new_unbounded(min: u32) -> Self
pub const fn new_single(min_and_max: u32) -> Self
pub fn with_ts_span(self, ts_span: Span) -> Self
pub fn has_ts_span(&self) -> bool
pub fn ts_span(&self) -> Option<&Span>
pub fn set_ts_span(&mut self, span: Span)
pub fn unset_ts_span(&mut self)
pub fn min_occurs(&self) -> u32
pub fn max_occurs(&self) -> Option<u32>
pub fn is_optional(&self) -> bool
pub fn is_required(&self) -> bool
pub fn is_range(&self) -> bool
pub fn is_unbounded(&self) -> bool
pub fn is_exactly(&self, value: u32) -> bool
pub fn to_uml_string(&self) -> String
Trait Implementations§
source§impl Clone for Cardinality
impl Clone for Cardinality
source§fn clone(&self) -> Cardinality
fn clone(&self) -> Cardinality
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§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
source§impl<'de> Deserialize<'de> for Cardinality
impl<'de> Deserialize<'de> for Cardinality
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<Cardinality> for Cardinality
impl PartialEq<Cardinality> for Cardinality
source§fn eq(&self, other: &Cardinality) -> bool
fn eq(&self, other: &Cardinality) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for Cardinality
impl Serialize for Cardinality
impl Eq for Cardinality
impl StructuralEq for Cardinality
impl StructuralPartialEq for Cardinality
Auto Trait Implementations§
impl RefUnwindSafe for Cardinality
impl Send for Cardinality
impl Sync for Cardinality
impl Unpin 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