#[non_exhaustive]pub enum MixingPolicy {
Exclusive,
PublicKeyMixable,
Custom {
compatibility_class: &'static str,
},
}Expand description
Public diagnostic category for a recipient mixing rule, surfaced
through CryptoError::IncompatibleRecipients.
This is intentionally not the full internal enforcement representation
— that is the crate-private NativeMixingRule type, which can express
new native compatibility classes without adding public enum variants.
MixingPolicy::Custom is the catch-all for compatibility classes
that do not match the two fixed shorthand variants below; the
associated compatibility_class string preserves which class the
offending rule declared, so programmatic diagnostics can distinguish
(for example) a post-quantum class clash from any future custom class.
The enum is #[non_exhaustive] so future native rules can be added
without a breaking API change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Exclusive
This recipient must appear alone — not mixed with any other
entry, including unknown non-critical ones. Currently:
argon2id.
PublicKeyMixable
Standard public-key mixability: multiple recipients of this
type are permitted, alongside other public-key recipients in
the same compatibility class. Currently: x25519.
Custom
A recipient-specific compatibility class not represented by the
fixed shorthand variants above. The compatibility_class field
carries the class identifier the offending rule declared so a
caller can distinguish — for example — a post-quantum class
clash ("postquantum") from a future custom class.
Trait Implementations§
Source§impl Clone for MixingPolicy
impl Clone for MixingPolicy
Source§fn clone(&self) -> MixingPolicy
fn clone(&self) -> MixingPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more