pub struct IntentPreflightInput {
pub issue: Option<String>,
pub paths: String,
}Expand description
The work to preflight: an issue, or the paths it will touch.
paths is one comma-separated string rather than a list because a preflight changes
nothing and is therefore a GET, and this repository binds a GET input to the query
string.
use majordomus_cli::capability::builtin::intents::IntentPreflightInput;
// an issue, when the work executes one
let by_issue = IntentPreflightInput { issue: Some("I1900".into()), paths: String::new() };
assert!(by_issue.path_list().is_empty());
// or the paths it will touch, when it names no issue yet
let by_paths = IntentPreflightInput {
issue: None,
paths: "apps/majordomus-cli/src,docs".into(),
};
assert_eq!(by_paths.path_list(), ["apps/majordomus-cli/src", "docs"]);Fields§
§issue: Option<String>The issue the work executes, by id. When given, the paths are not consulted.
paths: StringRepository-relative paths the work will touch, separated by commas.
Implementations§
Source§impl IntentPreflightInput
impl IntentPreflightInput
Sourcepub fn path_list(&self) -> Vec<String>
pub fn path_list(&self) -> Vec<String>
The paths as a list: trimmed, with the empties a trailing or doubled comma leaves dropped, so a query string written by hand resolves the same way as one written by a program.
use majordomus_cli::capability::builtin::intents::IntentPreflightInput;
let i = IntentPreflightInput { issue: None, paths: " lib, ,docs/X.md".into() };
assert_eq!(i.path_list(), ["lib", "docs/X.md"]);Trait Implementations§
Source§impl BenchmarkCases for IntentPreflightInput
impl BenchmarkCases for IntentPreflightInput
Source§fn benchmark_cases(ctx: &CaseContext<'_>) -> Vec<NamedCase<Self>>
fn benchmark_cases(ctx: &CaseContext<'_>) -> Vec<NamedCase<Self>>
The cases, in a stable order. An empty list means “nothing to benchmark in this
repository”, which the coverage check reports as missing.
Source§fn benchmark_cases_json(ctx: &CaseContext<'_>) -> Vec<NamedCase<Value>>
fn benchmark_cases_json(ctx: &CaseContext<'_>) -> Vec<NamedCase<Value>>
The cases as JSON, the shape every runner serialises from.
Source§impl Clone for IntentPreflightInput
impl Clone for IntentPreflightInput
Source§fn clone(&self) -> IntentPreflightInput
fn clone(&self) -> IntentPreflightInput
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 IntentPreflightInput
impl Debug for IntentPreflightInput
Source§impl Default for IntentPreflightInput
impl Default for IntentPreflightInput
Source§fn default() -> IntentPreflightInput
fn default() -> IntentPreflightInput
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for IntentPreflightInput
impl<'de> Deserialize<'de> for IntentPreflightInput
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 IntentPreflightInput
Source§impl JsonSchema for IntentPreflightInput
impl JsonSchema for IntentPreflightInput
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 moreSource§impl PartialEq for IntentPreflightInput
impl PartialEq for IntentPreflightInput
Source§fn eq(&self, other: &IntentPreflightInput) -> bool
fn eq(&self, other: &IntentPreflightInput) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for IntentPreflightInput
impl Serialize for IntentPreflightInput
impl StructuralPartialEq for IntentPreflightInput
Auto Trait Implementations§
impl Freeze for IntentPreflightInput
impl RefUnwindSafe for IntentPreflightInput
impl Send for IntentPreflightInput
impl Sync for IntentPreflightInput
impl Unpin for IntentPreflightInput
impl UnsafeUnpin for IntentPreflightInput
impl UnwindSafe for IntentPreflightInput
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.