pub enum ItemKind {
Task,
Project,
}Expand description
The kind of work item named by a dependency endpoint.
Variants§
Implementations§
Source§impl ItemKind
impl ItemKind
Sourcepub const METADATA_KEY: &'static str = "onetaskgraph.item_kind"
pub const METADATA_KEY: &'static str = "onetaskgraph.item_kind"
The reserved metadata key an item is marked with when its backend cannot say which kind it is.
Spelled once, here, for the reason Repository::METADATA_KEY is: a key under
this product’s prefix belongs to the product, and a plugin inventing its own
spelling would collide with the next one to want it.
Unlike the other two reserved keys, this one obliges no source. A backend that
knows its own kinds — folders, native projects — never reads or writes it, and
passes it through as ordinary caller metadata with its JSON type intact, exactly
as it passes through every other key it does not own. github-projects is the one
source that needs it, because a GitHub Projects board holds only issues and an
empty project is indistinguishable from a task without it.
Sourcepub const fn marker(self) -> &'static str
pub const fn marker(self) -> &'static str
The value this kind is marked with under Self::METADATA_KEY.
Sourcepub fn from_metadata(
metadata: &BTreeMap<String, Value>,
) -> Result<Option<Self>, String>
pub fn from_metadata( metadata: &BTreeMap<String, Value>, ) -> Result<Option<Self>, String>
The kind metadata marks, or None when it carries no marker at all.
§Errors
Returns a message when Self::METADATA_KEY holds anything other than the two
markers Self::marker spells.
Trait Implementations§
impl Copy for ItemKind
Source§impl<'de> Deserialize<'de> for ItemKind
impl<'de> Deserialize<'de> for ItemKind
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 ItemKind
Source§impl JsonSchema for ItemKind
impl JsonSchema for ItemKind
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