pub enum Tag {
Anonymous,
Context(u8),
Common(u32),
Implicit(u32),
FullyQualified {
vendor: u16,
profile: u16,
number: u32,
},
}Expand description
An element’s tag (Core §A.2).
A tag is optional: an element without one is anonymous. The rest identify the element either within its containing structure (context-specific) or globally (profile-specific).
Variants§
Anonymous
No tag — §A.2.3. The only form allowed for array members and for the outermost element of an encoding.
Context(u8)
A context-specific tag: one octet, meaningful only inside its containing structure or list (§A.2.2).
Common(u32)
A tag in the Matter Common Profile (§A.8.3).
Implicit(u32)
A profile-specific tag whose vendor and profile come from the protocol context the encoding travels in (§A.8.2).
FullyQualified
A fully-qualified profile-specific tag (§A.8.1).
Implementations§
Source§impl Tag
impl Tag
Sourcepub const fn is_anonymous(self) -> bool
pub const fn is_anonymous(self) -> bool
Whether this is Tag::Anonymous.
Sourcepub const fn encoded_len(self) -> usize
pub const fn encoded_len(self) -> usize
How many octets this tag occupies on the wire.
Sourcepub fn canonical_cmp(self, other: Self) -> Ordering
pub fn canonical_cmp(self, other: Self) -> Ordering
Orders two tags by the canonical rules of §A.2.4, which a signature over a structure depends on.
The rules are stated in terms of Vendor ID and profile number, so
Tag::Implicit — whose vendor and profile come from the protocol context — has
no defined place among fully-qualified tags. It is ordered after
Tag::Common and before Tag::FullyQualified here; a caller that mixes
implicit tags with fully-qualified ones in one container and then signs it must
resolve the implicit ones to their profile first.