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>>,
pub metadata: Vec<MetadataMatch>,
pub origin: Option<String>,
}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.
metadata: Vec<MetadataMatch>Caller-defined metadata values to keep: a task matches when every one of these
holds of its Task::metadata. Empty means unfiltered.
Defaulted when absent and left out of the wire when empty, so a plugin written before
there were metadata matches reads exactly the query it read before — and, declaring no
Capabilities::filter_by_metadata, is never
handed one it would have to ignore.
origin: Option<String>The copy origin to keep: a task matches when its
ORIGIN_KEY metadata entry is a string equal to this, exactly.
None means unfiltered.
A qualified id — <source>:<native> — spelled exactly as a copy stores it. A
plugin never constructs or interprets one: it compares this string with the one it
holds, byte for byte, and nothing else, which is why it is a string here rather than
the engine’s own qualified-id type.
Defaulted when absent and left out of the wire when None, on the terms
metadata gives, with
Capabilities::filter_by_origin.
Implementations§
Source§impl TaskQuery
impl TaskQuery
Sourcepub const ORIGIN_KEY: &'static str = "onetaskgraph.origin"
pub const ORIGIN_KEY: &'static str = "onetaskgraph.origin"
The reserved metadata key a copied item records the qualified id it was copied from
under, which origin is compared with.
The engine owns this key; it is restated here so a source applying the predicate
natively and the engine narrowing for one that does not read the same entry.
scripts/check-origin-key-spelling.sh holds this spelling to the engine’s own.
Sourcepub fn metadata_matches(&self, metadata: &BTreeMap<String, Value>) -> bool
pub fn metadata_matches(&self, metadata: &BTreeMap<String, Value>) -> bool
Whether metadata — one task’s — satisfies every metadata match:
always when the query carries none.
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.
Sourcepub fn origin_matches(&self, metadata: &BTreeMap<String, Value>) -> bool
pub fn origin_matches(&self, metadata: &BTreeMap<String, Value>) -> bool
Whether metadata — one task’s — satisfies origin: always when the
query carries none, and otherwise exactly when its ORIGIN_KEY
entry is a string equal to it.
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