#[non_exhaustive]#[repr(u8)]pub enum Tag {
Message = 0,
Push = 1,
Rekey = 2,
Final = 3,
}Expand description
Secret stream message tag.
Each message pushed to a DryocStream carries one
tag, which is encrypted and authenticated with the message. The variants
are exactly libsodium’s four crypto_secretstream_xchacha20poly1305_TAG_*
values, and Tag::bits returns the byte stored in the stream. Convert a
tag byte with Tag::try_from, which rejects every other byte.
Tag is #[non_exhaustive] so that a tag value libsodium may add to the
secretstream format later can become a new variant without a breaking
change; a match on Tag outside this crate therefore needs a wildcard
arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Message = 0
A normal message in a stream (TAG_MESSAGE, 0).
Push = 1
Marks the end of a series of messages in a stream, but not the end of
the stream (TAG_PUSH, 1).
Rekey = 2
Derives a new key for the stream after this message (TAG_REKEY, 2).
Final = 3
Marks the end of the stream, and rekeys after this message
(TAG_FINAL, 3).