[][src]Struct cddl_cat::ivt::Occur

pub struct Occur {
    pub limit: OccurLimit,
    pub node: Box<Node>,
}

Occurences specify how many times a value can appear.

This implementation wraps the Node that the occurrence applies to.

Fields

limit: OccurLimitnode: Box<Node>

Implementations

impl Occur[src]

pub fn new(limit: OccurLimit, node: Node) -> Occur[src]

Creates a new Occur from one of the CDDL occurrence chars ?*+

pub fn symbol(&self) -> String[src]

Get the CDDL symbol for this occurrence.

Returns ?, *, +, or n*m

pub fn limits(&self) -> (usize, usize)[src]

Return the lower and upper limits on this occurrence

Occurrences can always be represented by an inclusive [lower, upper] count limit.

required => [1, 1] optional "?" => [0, 1] zero-or-more "*" => [0, MAX] one-or-more "+" => [1, MAX]

Trait Implementations

impl Clone for Occur[src]

impl Debug for Occur[src]

impl Display for Occur[src]

impl PartialEq<Occur> for Occur[src]

impl StructuralPartialEq for Occur[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.