[][src]Enum cddl::token::Token

pub enum Token {
    ILLEGAL(String),
    EOF,
    IDENT((String, Option<SocketPlug>)),
    VALUE(Value),
    TAG((Option<u8>, Option<usize>)),
    ASSIGN,
    OPTIONAL,
    ASTERISK,
    ONEORMORE,
    UNWRAP,
    COMMA,
    COLON,
    COMMENT(String),
    TCHOICE,
    GCHOICE,
    TCHOICEALT,
    GCHOICEALT,
    ARROWMAP,
    CUT,
    RANGEOP(bool),
    RANGE((RangeValue, RangeValue, bool)),
    LPAREN,
    RPAREN,
    LBRACE,
    RBRACE,
    LBRACKET,
    RBRACKET,
    LANGLEBRACKET,
    RANGLEBRACKET,
    SIZE,
    BITS,
    CREGEXP,
    CBOR,
    CBORSEQ,
    WITHIN,
    AND,
    LT,
    LE,
    GT,
    GE,
    EQ,
    NE,
    DEFAULT,
    PCRE,
    GTOCHOICE,
    FALSE,
    TRUE,
    BOOL,
    NIL,
    NULL,
    UINT,
    NINT,
    INT,
    FLOAT16,
    FLOAT32,
    FLOAT64,
    FLOAT1632,
    FLOAT3264,
    FLOAT,
    BSTR,
    TSTR,
    ANY,
    BYTES,
    TEXT,
    TDATE,
    TIME,
    NUMBER,
    BIGUINT,
    BIGNINT,
    BIGINT,
    INTEGER,
    UNSIGNED,
    DECFRAC,
    BIGFLOAT,
    EB64URL,
    EB64LEGACY,
    EB16,
    ENCODEDCBOR,
    URI,
    B64URL,
    B64LEGACY,
    REGEXP,
    MIMEMESSAGE,
    CBORANY,
    UNDEFINED,
}

Token which represents a valids CDDL character or sequence

Variants

ILLEGAL(String)

Illegal sequence of characters

EOF

End of file

Identifier with optional SocketPlug

VALUE(Value)

Value

CBOR tag '#'

ASSIGN

Assignment operator '='

OPTIONAL

Optional occurrence indicator '?'

ASTERISK

Zero or more occurrence indicator '*'

ONEORMORE

One or more occurrence indicator '+'

UNWRAP

Unwrap operator '~'

COMMA

Comma ','

COLON

Colon ':'

COMMENT(String)

Comment text

TCHOICE

Type choice indicator '/'

GCHOICE

Group choice indicator '//'

TCHOICEALT

Type choice alternative '/='

GCHOICEALT

Group choice alternative '//='

ARROWMAP

Arrow map '=>'

CUT

Cut '^'

RANGEOP(bool)

Range operator. Inclusive '..' if true, otherwise exclusive '...'s

Range tuple with lower bound, upper bound, and bool indicating whether or not the range is inclusive

LPAREN

Left opening parend

RPAREN

Right closing parend

LBRACE

Left opening brace

RBRACE

Right closing brace

LBRACKET

Left opening bracket

RBRACKET

Right closing bracket

LANGLEBRACKET

Left opening angle bracket

RANGLEBRACKET

Right closing angle bracket

SIZE

.size control operator

BITS

.bits control operator

CREGEXP

.regexp control operator

CBOR

.cbor control operator

CBORSEQ

.cborseq control operator

WITHIN

.within control operator

AND

.and control operator

LT

.lt control operator

LE

.le control operator

GT

.gt control operator

GE

.ge control operator

EQ

.eq control operator

NE

.ne control operator

DEFAULT

.default control operator

PCRE

.pcre control operator Proposed control extension to support Perl-Compatible Regular Expressions (PCREs). See https://tools.ietf.org/html/rfc8610#section-3.8.3.2s

GTOCHOICE

group to choice enumeration '&'

FALSE

false

TRUE

true

BOOL

bool

NIL

nil

NULL

null

UINT

uint

NINT

nint

INT

int

FLOAT16

float16

FLOAT32

float32

FLOAT64

float64

FLOAT1632

float16-32

FLOAT3264

float32-64

FLOAT

float

BSTR

bstr

TSTR

tstr

ANY

any

BYTES

bytes

TEXT

text

TDATE

tdate

TIME

time

NUMBER

number

BIGUINT

biguint

BIGNINT

bignint

BIGINT

bigint

INTEGER

integer

UNSIGNED

unsigned

DECFRAC

decfrac

BIGFLOAT

bigfloat

EB64URL

eb64url

EB64LEGACY

eb64legacy

EB16

eb16k

ENCODEDCBOR

encoded-cbor

URI

uri

B64URL

b64url

B64LEGACY

b64legacy

REGEXP

regexp

MIMEMESSAGE

mime-message

CBORANY

cbor-any

UNDEFINED

undefined

Methods

impl Token[src]

pub fn in_standard_prelude(&self) -> Option<&'static str>[src]

Returns optional string literal of token in standard prelude

Trait Implementations

impl Debug for Token[src]

impl Display for Token[src]

impl PartialEq<Token> for Token[src]

impl StructuralPartialEq for Token[src]

impl TryFrom<Token> for RangeValue[src]

type Error = &'static str

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Token

impl Send for Token

impl Sync for Token

impl Unpin for Token

impl UnwindSafe for Token

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> 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.