Skip to main content

DependencyEdge

Struct DependencyEdge 

Source
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: DependencyEndpoint

The 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: DependencyEndpoint

The item the edge points at, and the one that must finish first.

§kind: DependencyKind

What the edge means.

Implementations§

Source§

impl DependencyEdge

Source

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.

Source

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

Source§

fn clone(&self) -> DependencyEdge

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DependencyEdge

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for DependencyEdge

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for DependencyEdge

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for DependencyEdge

Source§

fn eq(&self, other: &DependencyEdge) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for DependencyEdge

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DependencyEdge

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.