pub struct InstanceConfig {
pub reserved: Vec<String>,
pub gates: BTreeMap<String, GateFilters>,
}Expand description
The declaration as written.
Fields§
§reserved: Vec<String>Paths no delivered gate judges. Another tool owns these.
gates: BTreeMap<String, GateFilters>Per-gate filters, keyed by gate id. A gate not named here takes its registry default.
Implementations§
Source§impl InstanceConfig
impl InstanceConfig
Sourcepub fn parse(text: &str) -> Result<Self, ConfigError>
pub fn parse(text: &str) -> Result<Self, ConfigError>
Parse a declaration.
§Errors
ConfigError::Shape when the text is not a declaration, and
ConfigError::UnknownGate when a gates: key names no delivered
gate. Neither falls back to the default: a filter that quietly stops
applying is worse than one that fails loudly.
Sourcepub fn read(repo_root: &Utf8Path) -> Result<Self, ConfigError>
pub fn read(repo_root: &Utf8Path) -> Result<Self, ConfigError>
Read the declaration an instance carries.
A missing file is the empty declaration and never an error: an instance that declares nothing is a valid instance.
§Errors
See Self::parse. An unreadable file that exists is a shape error
rather than a silent default.
Sourcepub fn for_gate(&self, id: GateId) -> Option<&GateFilters>
pub fn for_gate(&self, id: GateId) -> Option<&GateFilters>
This gate’s declared filters, if the project named it.
Trait Implementations§
Source§impl Clone for InstanceConfig
impl Clone for InstanceConfig
Source§fn clone(&self) -> InstanceConfig
fn clone(&self) -> InstanceConfig
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 moreSource§impl Debug for InstanceConfig
impl Debug for InstanceConfig
Source§impl Default for InstanceConfig
impl Default for InstanceConfig
Source§fn default() -> InstanceConfig
fn default() -> InstanceConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for InstanceConfig
impl<'de> Deserialize<'de> for InstanceConfig
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
impl Eq for InstanceConfig
Source§impl PartialEq for InstanceConfig
impl PartialEq for InstanceConfig
impl StructuralPartialEq for InstanceConfig
Auto Trait Implementations§
impl Freeze for InstanceConfig
impl RefUnwindSafe for InstanceConfig
impl Send for InstanceConfig
impl Sync for InstanceConfig
impl Unpin for InstanceConfig
impl UnsafeUnpin for InstanceConfig
impl UnwindSafe for InstanceConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.