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.