pub struct TaskQuery {
pub text: Option<TextQuery>,
pub labels: LabelFilter,
pub statuses: Vec<StatusCategory>,
pub project: ProjectFilter,
pub priorities: Vec<Priority>,
pub commented_since: Option<DateTime<Utc>>,
}Expand description
A filter over a source’s tasks.
Every field narrows; an empty or None field means unfiltered.
Fields§
§text: Option<TextQuery>Free-text search, when the caller asked for one.
labels: LabelFilterLabel membership.
statuses: Vec<StatusCategory>Status categories to keep. Empty means unfiltered.
project: ProjectFilterWhich project the task belongs to.
priorities: Vec<Priority>Priorities to keep: a task matches when its priority is any one of these. Empty means unfiltered.
Defaulted when absent and left out of the wire when empty, so a plugin written before
there were priorities reads exactly the query it read before — and, declaring no
Capabilities::filter_by_priority, is never
handed one it would have to ignore.
commented_since: Option<DateTime<Utc>>Comment activity to keep: a task matches when at least one of its comments was
created, or last edited, at or after this instant — its
Comment::created_at or
Comment::updated_at is at or after it. A task with no
comments never matches, and a comment deleted before the query is not a match. None
means unfiltered. An RFC 3339 string on the wire.
Defaulted when absent and left out of the wire when None, so a plugin written before
there was comment activity reads exactly the query it read before — and, declaring no
Capabilities::filter_by_comment_activity,
is never handed one it would have to ignore.
Implementations§
Source§impl TaskQuery
impl TaskQuery
Sourcepub fn comments_match<'a>(
&self,
comments: impl IntoIterator<Item = &'a Comment>,
) -> bool
pub fn comments_match<'a>( &self, comments: impl IntoIterator<Item = &'a Comment>, ) -> bool
Whether comments — one task’s — satisfy commented_since:
always when the query carries no instant, and otherwise exactly when one of them was
created or last edited at or after it.
The one statement of the predicate’s meaning, so a source applying it natively and the engine narrowing for a source that does not cannot answer the same store differently.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskQuery
impl<'de> Deserialize<'de> for TaskQuery
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>,
Source§impl JsonSchema for TaskQuery
impl JsonSchema for TaskQuery
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more