pub struct Protected {
pub components: Vec<ProtectedComponent>,
pub extra_paths: Vec<String>,
}Expand description
The set of components evolution may not propose changes to.
Fields§
§components: Vec<ProtectedComponent>§extra_paths: Vec<String>Extra dotted config paths to protect beyond the named components, for anything this enum does not anticipate.
Implementations§
Source§impl Protected
impl Protected
Sourcepub fn is_protected(&self, path: &str) -> bool
pub fn is_protected(&self, path: &str) -> bool
Whether a dotted config path is off limits to evolution.
safety.protected is hard-coded rather than looked up: a config that
dropped Protected from its own component list would otherwise be free
to propose putting everything else back, which defeats the section.
Sourcepub fn touches(&self, path: &str) -> bool
pub fn touches(&self, path: &str) -> bool
Whether writing path would change anything protected: the path is
protected itself, or a protected path sits beneath it.
The second half is the one that matters for a patch. Replacing all of
safety touches no protected key by name, and overwrites every one.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Protected
impl<'de> Deserialize<'de> for Protected
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Protected
impl JsonSchema for Protected
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for Protected
impl RefUnwindSafe for Protected
impl Send for Protected
impl Sync for Protected
impl Unpin for Protected
impl UnsafeUnpin for Protected
impl UnwindSafe for Protected
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