pub struct RoadmapFilter {
pub period_from: Option<String>,
pub period_to: Option<String>,
pub owner: Option<String>,
pub status: Option<String>,
pub labels: Vec<String>,
pub query: Option<String>,
}Expand description
The normalized cross-surface roadmap filter (data-model §3).
All criteria are optional, so the default value is the empty filter; an empty
filter narrows nothing and selects every initiative. The field names are the
serialized names (see the serde attributes) and are stable: they are what
the MCP tool arguments and the local portable DTO carry, so a renamed field
would be a breaking change to every surface at once.
Unknown serialized fields are refused (deny_unknown_fields), which is
deliberate: with a permissive reader a typo’d key ("ownerr") would silently
drop the criterion and return more rows than asked for. A filter is a strict
input; the forward-compatibility budget this mission spends is on the preserved
initiative extensions, not on a query language.
Fields§
§period_from: Option<String>Inclusive lower bound on the initiative target date (YYYY-MM-DD).
period_to: Option<String>Inclusive upper bound on the initiative target date (YYYY-MM-DD).
owner: Option<String>Owner identity to match; compared trimmed and case-insensitively.
status: Option<String>Initiative status to match; compared trimmed and case-insensitively.
labels: Vec<String>Labels the initiative must all carry; each compared trimmed and case-insensitively, order irrelevant.
query: Option<String>Free text matched case-insensitively against name/outcome/owner/status/labels.
Implementations§
Source§impl RoadmapFilter
impl RoadmapFilter
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether this filter carries no criterion at all — the documented “no filter” value.
RoadmapFilter::default() is the empty filter, so a call site that supports
“show everything” has one value to pass rather than four Nones it must
keep in step. A blank query counts as absent because it narrows nothing;
blank owner/status/labels are refusals and so are assumed absent here
once Self::validate has run.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validate the filter’s syntax before any projection runs.
Refuses: a period_from/period_to that is not a YYYY-MM-DD calendar date
(the shared crate::model::validate_date rule, the same one the record’s
own loader uses), a period whose lower bound is after its upper bound, and a
present-but-blank owner, status, or labels entry. A well-formed value
that names no initiative is not refused — it matches nothing (see the
module docs).
Sourcepub fn matches(&self, initiative: &InitiativeConfiguration) -> bool
pub fn matches(&self, initiative: &InitiativeConfiguration) -> bool
Whether one initiative record satisfies every criterion this filter sets.
Purely read-only: it inspects the record and mutates nothing. An empty filter matches every record.
Trait Implementations§
Source§impl Clone for RoadmapFilter
impl Clone for RoadmapFilter
Source§impl Debug for RoadmapFilter
impl Debug for RoadmapFilter
Source§impl Default for RoadmapFilter
impl Default for RoadmapFilter
Source§impl<'de> Deserialize<'de> for RoadmapFilterwhere
RoadmapFilter: Default,
impl<'de> Deserialize<'de> for RoadmapFilterwhere
RoadmapFilter: Default,
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>,
impl Eq for RoadmapFilter
Source§impl PartialEq for RoadmapFilter
impl PartialEq for RoadmapFilter
Source§impl Serialize for RoadmapFilter
impl Serialize for RoadmapFilter
impl StructuralPartialEq for RoadmapFilter
Auto Trait Implementations§
impl Freeze for RoadmapFilter
impl RefUnwindSafe for RoadmapFilter
impl Send for RoadmapFilter
impl Sync for RoadmapFilter
impl Unpin for RoadmapFilter
impl UnsafeUnpin for RoadmapFilter
impl UnwindSafe for RoadmapFilter
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more