pub struct DependencyEdge {
pub from: DependencyEndpoint,
pub to: DependencyEndpoint,
pub kind: DependencyKind,
}Expand description
A dependency between two work items.
An endpoint may name another source. Keeping that far id on the near item is work data owned by its plugin, not an engine-side index or mirror; the engine reports it without resolving or fetching the far item.
A source uses its backend’s own relationship wherever that relationship can name the
far end, so the backend knows the graph and its own interface draws it. Where it
cannot — a far end in another source, which no backend relates — the source reads
Self::recorded from the near item instead. Only the forward direction is ever
recorded; the reverse of a recorded edge is derived, exactly as a
ForwardOnly source’s reverse is.
Fields§
§from: DependencyEndpointThe item the edge starts at, and the one that depends on the other.
This is the orientation every source reports in, whichever way its own backend
spells the relationship: a GitHub blockedBy connection read for ENG-1 yields
from: ENG-1, because ENG-1 is what depends.
to: DependencyEndpointThe item the edge points at, and the one that must finish first.
kind: DependencyKindWhat the edge means.
Implementations§
Source§impl DependencyEdge
impl DependencyEdge
Sourcepub const RECORDED_KEY: &'static str = "onetaskgraph.depends_on"
pub const RECORDED_KEY: &'static str = "onetaskgraph.depends_on"
The reserved metadata key a near item records a far end under.
Spelled once, here, for the reason Repository::METADATA_KEY is: a plugin that
invented its own spelling would record a plan nothing else could read.
Sourcepub fn recorded(
metadata: &BTreeMap<String, Value>,
near: &NativeId,
near_kind: ItemKind,
near_source: &SourceName,
natively_names: Option<ItemKind>,
) -> Result<Vec<Self>, String>
pub fn recorded( metadata: &BTreeMap<String, Value>, near: &NativeId, near_kind: ItemKind, near_source: &SourceName, natively_names: Option<ItemKind>, ) -> Result<Vec<Self>, String>
The forward edges near records under Self::RECORDED_KEY, or none.
The key holds a list of endpoints — a bare string is a native id naming a task,
and {"id": "<source>:<native>", "kind": "project"} names any item of any source.
Each becomes one blocks edge from near to that endpoint.
natively_names is the kind of item the near item’s own backend can relate it
to — Some(ItemKind::Task) for a GitHub issue, whose blockedBy connection holds
issues; None for a GitHub draft, which has no such connection at all. An endpoint
of that kind naming an item of near_source is refused, because it names an item
the backend itself could hold, and the rule this key exists to serve is the
backend’s own relationship first. Naming one’s own source is what an unqualified id
does implicitly and what <near_source>:<native> does in writing, so both are
refused: which of the two spellings a plan happened to use says nothing about where
the edge belongs.
An endpoint qualified to a different source is never refused. That is the whole case this key is for: no backend relates an id in a system it knows nothing about.
§Errors
Returns a message when the key holds anything other than a list of endpoints, or holds one the near item’s own backend was supposed to name.
Trait Implementations§
Source§impl Clone for DependencyEdge
impl Clone for DependencyEdge
Source§fn clone(&self) -> DependencyEdge
fn clone(&self) -> DependencyEdge
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DependencyEdge
impl Debug for DependencyEdge
Source§impl<'de> Deserialize<'de> for DependencyEdge
impl<'de> Deserialize<'de> for DependencyEdge
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 DependencyEdge
impl JsonSchema for DependencyEdge
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