pub struct GateClass {
pub id: String,
pub paths: Vec<String>,
pub except: Vec<String>,
pub gates: Option<GateClassSelects>,
}Expand description
use majordomus_cli::gates::GateClass;
// one path class as the CI model declares it: which paths select which gates
let class: GateClass = serde_json::from_value(serde_json::json!({
"id": "docs",
"paths": ["docs/**"],
"gates": ["reference-check"]
}))
.unwrap();
assert_eq!(class.id, "docs");
assert_eq!(class.paths, ["docs/**"]);One path class: the paths it covers and the gates a change to them selects.
Fields§
§id: StringThe class’s identity.
paths: Vec<String>The pathspecs it covers, in the subset the model’s header defines.
except: Vec<String>Single paths its patterns cover and the class does not: a data file under an escalating directory, read by named gates only. Each one is a path, never a pattern, so a file that appears under the directory tomorrow still falls in it.
gates: Option<GateClassSelects>full, or the gates it names.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GateClass
impl<'de> Deserialize<'de> for GateClass
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 GateClass
impl JsonSchema for GateClass
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 inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreAuto Trait Implementations§
impl Freeze for GateClass
impl RefUnwindSafe for GateClass
impl Send for GateClass
impl Sync for GateClass
impl Unpin for GateClass
impl UnsafeUnpin for GateClass
impl UnwindSafe for GateClass
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