Struct cbor_diag::Tag

source ·
pub struct Tag(pub u64);
Expand description

A semantic tag for a CBOR data item.

See RFC 7049 § 2.4: Table 3 and the CBOR Tags IANA Registry

Tuple Fields§

§0: u64

Implementations§

source§

impl Tag

source

pub const DATETIME: Tag = _

A “Standard date/time string”; must only be applied to a text string (or the indefinite variant of) data item.

See RFC 7049 § 2.4.1 for more details on how to interpret the string.

Defined in RFC 7049 § 2.4: Table 3.

source

pub const EPOCH_DATETIME: Tag = _

An “Epoch-based date/time”; must only be applied to an unsigned integer, negative integer or floating point data item.

See RFC 7049 § 2.4.1 for more details on how to interpret the value.

Defined in RFC 7049 § 2.4: Table 3.

source

pub const POSITIVE_BIGNUM: Tag = _

A “positive bignum”; must only be applied to a byte string (or the indefinite variant of) data item.

See RFC 7049 § 2.4.2 for more details on how to interpret the bytes.

Defined in RFC 7049 § 2.4: Table 3.

source

pub const NEGATIVE_BIGNUM: Tag = _

A “negative bignum”; must only be applied to a byte string (or the indefinite variant of) data item.

See RFC 7049 § 2.4.2 for more details on how to interpret the bytes.

Defined in RFC 7049 § 2.4: Table 3.

source

pub const DECIMAL_FRACTION: Tag = _

A “decimal fraction”; must only be applied to an array containing exactly two data items, the first must be either a unsigned integer or negative integer, the second can be either of those or additionally a positive or negative bignum.

See RFC 7049 § 2.4.3 for more details on how to interpret the values.

Defined in RFC 7049 § 2.4: Table 3.

source

pub const BIGFLOAT: Tag = _

A “bigfloat”; must only be applied to an array containing exactly two data items, the first must be either a unsigned integer or negative integer, the second can be either of those or additionally a positive or negative bignum.

See RFC 7049 § 2.4.3 for more details on how to interpret the values.

Defined in RFC 7049 § 2.4: Table 3.

source

pub const ENCODED_BASE64URL: Tag = _

Sets the expected encoding of any byte strings contained in the data item to be “base64url”; can be applied to any sort of data item.

See RFC 7049 § 2.4.4.2 for more details on how the expected encoding is applied.

Defined in RFC 7049 § 2.4: Table 3.

source

pub const ENCODED_BASE64: Tag = _

Sets the expected encoding of any byte strings contained in the data item to be “base64”; can be applied to any sort of data item.

See RFC 7049 § 2.4.4.2 for more details on how the expected encoding is applied.

Defined in RFC 7049 § 2.4: Table 3.

source

pub const ENCODED_BASE16: Tag = _

Sets the expected encoding of any byte strings contained in the data item to be “base16”; can be applied to any sort of data item.

See RFC 7049 § 2.4.4.2 for more details on how the expected encoding is applied.

Defined in RFC 7049 § 2.4: Table 3.

source

pub const ENCODED_CBOR: Tag = _

Marks this item as being an encoded CBOR data item; must only be applied to a byte string (or the indefinite variant of) data item.

See RFC 7049 § 2.4.4.1 for more details on what this means.

Defined in RFC 7049 § 2.4: Table 3.

source

pub const SHAREABLE: Tag = _

Marks this item as being potentially shared and referenced by a later Tag::SHARED_REF; can be applied to any sort of data item.

See http://cbor.schmorp.de/value-sharing for more details on what this means.

source

pub const SHARED_REF: Tag = _

Marks this item as being a reference to a previous Tag::SHAREABLE item; can only be applied to an unsigned integer date item.

See http://cbor.schmorp.de/value-sharing for more details on what this means.

source

pub const URI: Tag = _

Marks this item as being a valid URI; must only be applied to a text string (or the indefinite variant of) data item.

See RFC 7049 § 2.4.4.3 for more details on what this means.

Defined in RFC 7049 § 2.4: Table 3.

source

pub const BASE64URL: Tag = _

Marks this item as being a base64url encoded string; must only be applied to a text string (or the indefinite variant of) data item.

See RFC 7049 § 2.4.4.3 for more details on what this means.

Defined in RFC 7049 § 2.4: Table 3.

source

pub const BASE64: Tag = _

Marks this item as being a base64 encoded string; must only be applied to a text string (or the indefinite variant of) data item.

See RFC 7049 § 2.4.4.3 for more details on what this means.

Defined in RFC 7049 § 2.4: Table 3.

source

pub const REGEX: Tag = _

Marks this item as being a regex; must only be applied to a text string (or the indefinite variant of) data item.

See RFC 7049 § 2.4.4.3 for more details on what this means.

Defined in RFC 7049 § 2.4: Table 3.

source

pub const MIME: Tag = _

Marks this item as being a MIME message; must only be applied to a text string (or the indefinite variant of) data item.

See RFC 7049 § 2.4.4.3 for more details on what this means.

Defined in RFC 7049 § 2.4: Table 3.

source

pub const UUID: Tag = _

Marks this item as being a binary UUID; must only be applied to a byte string (or the indefinite variant of) data item.

See the spec for more details on what this means.

Defined in non-RFC specification.

source

pub const ENCODED_CBOR_SEQ: Tag = _

Marks this item as being an encoded CBOR sequence; must only be applied to a byte string (or the indefinite variant of) data item.

See RFC 8742 for more details on what this means.

Defined in draft-bormann-cbor-notable-tags § 2.1.

source

pub const IPV4: Tag = _

Marks this item as being an IPv4 address and/or prefix; must only be applied to a four-byte byte string (or the indefinite variant of) or 2-element array data item.

Defined in RFC 9164.

source

pub const IPV6: Tag = _

Marks this item as being an IPv6 address and/or prefix; must only be applied to a sixteen-byte byte string (or the indefinite variant of) or 2/3-element array data item.

Defined in RFC 9164.

source

pub const TYPED_ARRAY_U8: Tag = _

Mark this item as being an encoding of an array of u8 values; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_U16_BIG_ENDIAN: Tag = _

Mark this item as being an encoding of an array of u16 values in big endian encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_U32_BIG_ENDIAN: Tag = _

Mark this item as being an encoding of an array of u32 values in big endian encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_U64_BIG_ENDIAN: Tag = _

Mark this item as being an encoding of an array of u64 values in big endian encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_U8_CLAMPED: Tag = _

Mark this item as being an encoding of an array of u8 values (with JS specific “clamping”); must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_U16_LITTLE_ENDIAN: Tag = _

Mark this item as being an encoding of an array of u16 values in little endian encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_U32_LITTLE_ENDIAN: Tag = _

Mark this item as being an encoding of an array of u32 values in little endian encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_U64_LITTLE_ENDIAN: Tag = _

Mark this item as being an encoding of an array of u64 values in little endian encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_I8: Tag = _

Mark this item as being an encoding of an array of i8 values in twos-complement encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_I16_BIG_ENDIAN: Tag = _

Mark this item as being an encoding of an array of i16 values in big endian twos-complement encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_I32_BIG_ENDIAN: Tag = _

Mark this item as being an encoding of an array of i32 values in big endian twos-complement encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_I64_BIG_ENDIAN: Tag = _

Mark this item as being an encoding of an array of i64 values in big endian twos-complement encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_I16_LITTLE_ENDIAN: Tag = _

Mark this item as being an encoding of an array of i16 values in little endian twos-complement encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_I32_LITTLE_ENDIAN: Tag = _

Mark this item as being an encoding of an array of i32 values in little endian twos-complement encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_I64_LITTLE_ENDIAN: Tag = _

Mark this item as being an encoding of an array of i64 values in little endian twos-complement encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_F16_BIG_ENDIAN: Tag = _

Mark this item as being an encoding of an array of f16 values in big endian encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_F32_BIG_ENDIAN: Tag = _

Mark this item as being an encoding of an array of f32 values in big endian encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_F64_BIG_ENDIAN: Tag = _

Mark this item as being an encoding of an array of f64 values in big endian encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_F128_BIG_ENDIAN: Tag = _

Mark this item as being an encoding of an array of f128 values in big endian encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_F16_LITTLE_ENDIAN: Tag = _

Mark this item as being an encoding of an array of f16 values in little endian encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_F32_LITTLE_ENDIAN: Tag = _

Mark this item as being an encoding of an array of f32 values in little endian encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_F64_LITTLE_ENDIAN: Tag = _

Mark this item as being an encoding of an array of f64 values in little endian encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const TYPED_ARRAY_F128_LITTLE_ENDIAN: Tag = _

Mark this item as being an encoding of an array of f128 values in little endian encoding; must only be applied to a bytes string (or the [indefinite variant][DataItem::IndefiniteByteString) of) data item.

Defined in RFC 8746.

source

pub const EPOCH_DATE: Tag = _

Number of days since the epoch date 1970-01-01; must only be applied to an unsigned integer or negative integer data item.

Defined in RFC 8943.

source

pub const NETWORK_ADDRESS: Tag = _

Marks this item as being a Network Address (IPv4 or IPv6 or MAC Address); must only be applied to a byte string (or the indefinite variant of) data item.

See the spec for more details on what this means.

Defined in non-RFC specification.

[RFC 9164][] recommends usage of Tag::IPV4 or Tag::IPV6 instead where possible.

[RFC 9164]

source

pub const DATE: Tag = _

A “Standard date string”; must only be applied to a text string (or the indefinite variant of) data item.

Defined in RFC 8943, uses format from RFC 3339.

source

pub const SELF_DESCRIBE_CBOR: Tag = _

Marks this item as being CBOR, a no-op; can be applied to any type of data item.

See RFC 7049 § 2.4.5 for more details on why this is useful.

Defined in RFC 7049 § 2.4: Table 3.

Trait Implementations§

source§

impl Clone for Tag

source§

fn clone(&self) -> Tag

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Tag

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<Tag> for Tag

source§

fn eq(&self, other: &Tag) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Tag

source§

impl Eq for Tag

source§

impl StructuralEq for Tag

source§

impl StructuralPartialEq for Tag

Auto Trait Implementations§

§

impl RefUnwindSafe for Tag

§

impl Send for Tag

§

impl Sync for Tag

§

impl Unpin for Tag

§

impl UnwindSafe for Tag

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.