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
impl Tag
sourcepub const DATETIME: Tag = _
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.
sourcepub const EPOCH_DATETIME: Tag = _
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.
sourcepub const POSITIVE_BIGNUM: Tag = _
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.
sourcepub const NEGATIVE_BIGNUM: Tag = _
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.
sourcepub const DECIMAL_FRACTION: Tag = _
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.
sourcepub const BIGFLOAT: Tag = _
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.
sourcepub const ENCODED_BASE64URL: Tag = _
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.
sourcepub const ENCODED_BASE64: Tag = _
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.
sourcepub const ENCODED_BASE16: Tag = _
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.
sourcepub const ENCODED_CBOR: Tag = _
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.
sourcepub const SHAREABLE: Tag = _
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.
sourcepub const SHARED_REF: Tag = _
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.
sourcepub const URI: Tag = _
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.
sourcepub const BASE64URL: Tag = _
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.
sourcepub const BASE64: Tag = _
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.
sourcepub const REGEX: Tag = _
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.
sourcepub const MIME: Tag = _
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.
sourcepub const UUID: Tag = _
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.
sourcepub const ENCODED_CBOR_SEQ: Tag = _
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.
sourcepub const IPV4: Tag = _
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.
sourcepub const IPV6: Tag = _
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.
sourcepub const TYPED_ARRAY_U8: Tag = _
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.
sourcepub const TYPED_ARRAY_U16_BIG_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_U32_BIG_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_U64_BIG_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_U8_CLAMPED: Tag = _
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.
sourcepub const TYPED_ARRAY_U16_LITTLE_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_U32_LITTLE_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_U64_LITTLE_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_I8: Tag = _
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.
sourcepub const TYPED_ARRAY_I16_BIG_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_I32_BIG_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_I64_BIG_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_I16_LITTLE_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_I32_LITTLE_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_I64_LITTLE_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_F16_BIG_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_F32_BIG_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_F64_BIG_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_F128_BIG_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_F16_LITTLE_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_F32_LITTLE_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_F64_LITTLE_ENDIAN: Tag = _
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.
sourcepub const TYPED_ARRAY_F128_LITTLE_ENDIAN: Tag = _
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.
sourcepub const EPOCH_DATE: Tag = _
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.
sourcepub const NETWORK_ADDRESS: Tag = _
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]
sourcepub const DATE: Tag = _
pub const DATE: Tag = _
A “Standard date string”; must only be applied to a text string (or the indefinite variant of) data item.
sourcepub const SELF_DESCRIBE_CBOR: Tag = _
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.