pub struct ItemWrite<T> {
pub target: Option<NativeId>,
pub item: T,
pub depends_on: Vec<DependencyEdge>,
}Expand description
One create-or-update of a work item at a destination.
The two cases are one type because a destination decides between them by exactly one question — is there an item here to update — and the engine has already answered it.
Fields§
§target: Option<NativeId>The destination item to update, or None to create one.
A source handed a target it does not hold returns SourceError::Refused
rather than creating: the engine established that id before asking, so an absent
one is a race the destination must not paper over.
item: TThe item as the destination should hold it once the write lands.
Its id is the id the item was read under at the source. A destination
updating an item addresses target and ignores it; a destination
creating one may derive a name from it and is free not to. Its url, location,
created_at and updated_at are the destination’s own and are never written —
where the source holds an item says nothing about where the destination does.
depends_on: Vec<DependencyEdge>The forward dependency edges the copy read, with their far ends already resolved.
Each edge’s from is the item being written as the source named it, so a
destination reads the to and the kind of each and supplies its own near end.
A to naming another source is qualified and stays that way; a to inside the
copied set arrives as the destination’s own native id.
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for ItemWrite<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ItemWrite<T>where
T: Deserialize<'de>,
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<T> JsonSchema for ItemWrite<T>where
T: JsonSchema,
impl<T> JsonSchema for ItemWrite<T>where
T: JsonSchema,
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