pub enum ProtectionLevel {
None,
Sign,
Encrypt,
}Expand description
Abstract protection level for the policy layer.
Unlike ProtectionKind (XML parser type, 5 variants
incl. origin authentication), ProtectionLevel carries only the 3
base classes. Policy decisions compare/order these
levels — the origin-auth refinement follows from
PolicyDecision::suite (receiver-specific MACs, RC1).
The order None < Sign < Encrypt is relevant for the “strongest
value wins” matching in stage 3 (SEDP endpoint caps)
— Ord/PartialOrd are defined accordingly.
Variants§
None
No protection — plaintext RTPS on the wire.
Sign
Integrity protection (HMAC/AEAD tag), payload stays readable.
Encrypt
Integrity + confidentiality (AEAD ciphertext).
Implementations§
Source§impl ProtectionLevel
impl ProtectionLevel
Sourcepub fn from_protection_kind(kind: ProtectionKind) -> Self
pub fn from_protection_kind(kind: ProtectionKind) -> Self
Mapping from the governance-XML ProtectionKind. Origin-auth
variants collapse to their base class; the origin-auth
property is transported via PolicyDecision::suite +
receiver-specific MAC encoding.
Sourcepub fn to_protection_kind(self) -> ProtectionKind
pub fn to_protection_kind(self) -> ProtectionKind
Reverse mapping to ProtectionKind without origin-auth refinement.
Trait Implementations§
Source§impl Clone for ProtectionLevel
impl Clone for ProtectionLevel
Source§fn clone(&self) -> ProtectionLevel
fn clone(&self) -> ProtectionLevel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ProtectionLevel
Source§impl Debug for ProtectionLevel
impl Debug for ProtectionLevel
Source§impl Default for ProtectionLevel
impl Default for ProtectionLevel
Source§fn default() -> ProtectionLevel
fn default() -> ProtectionLevel
impl Eq for ProtectionLevel
Source§impl Hash for ProtectionLevel
impl Hash for ProtectionLevel
Source§impl Ord for ProtectionLevel
impl Ord for ProtectionLevel
Source§fn cmp(&self, other: &ProtectionLevel) -> Ordering
fn cmp(&self, other: &ProtectionLevel) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ProtectionLevel
impl PartialEq for ProtectionLevel
Source§fn eq(&self, other: &ProtectionLevel) -> bool
fn eq(&self, other: &ProtectionLevel) -> bool
self and other values to be equal, and is used by ==.