pub struct SubnetRule {
pub tag_prefix: String,
pub level: u8,
pub values: HashMap<String, u8>,
}Expand description
A single rule mapping a tag pattern to a hierarchy level.
Fields§
§tag_prefix: StringTag prefix to match (e.g., “region:”).
level: u8Which hierarchy level this tag fills (0-3).
values: HashMap<String, u8>Map from tag value to level value (e.g., “us-west” -> 1).
Implementations§
Source§impl SubnetRule
impl SubnetRule
Sourcepub fn map(self, tag_value: impl Into<String>, level_value: u8) -> Self
pub fn map(self, tag_value: impl Into<String>, level_value: u8) -> Self
Map a tag value to a level value.
§Panics
Panics if level_value is 0 (reserved for “unmatched /
no restriction”). For untrusted input prefer
Self::try_map.
Sourcepub fn try_map(
self,
tag_value: impl Into<String>,
level_value: u8,
) -> Result<Self, SubnetError>
pub fn try_map( self, tag_value: impl Into<String>, level_value: u8, ) -> Result<Self, SubnetError>
Fallible variant of Self::map.
Pre-existing map panics on level_value == 0.
Returns SubnetError::LevelValueReserved instead.
Trait Implementations§
Source§impl Clone for SubnetRule
impl Clone for SubnetRule
Source§fn clone(&self) -> SubnetRule
fn clone(&self) -> SubnetRule
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SubnetRule
impl RefUnwindSafe for SubnetRule
impl Send for SubnetRule
impl Sync for SubnetRule
impl Unpin for SubnetRule
impl UnsafeUnpin for SubnetRule
impl UnwindSafe for SubnetRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more