pub enum CopyAction {
Created {
destination: Option<GlobalId>,
via: NoCounterpart,
link: Option<CopyLink>,
},
Updated {
destination: GlobalId,
via: CopyVia,
link: Option<CopyLink>,
},
Unchanged {
destination: GlobalId,
via: CopyVia,
link: Option<CopyLink>,
},
Orphaned {
destination: GlobalId,
},
}Expand description
The four things a copy can do to one item, and the id each of them is about.
Variants§
Created
The destination held no counterpart, so one was created.
Fields
destination: Option<GlobalId>The id it was created under, or null for a dry run that would have created
one — there is no id, because nothing was.
via: NoCounterpartThat no rule found a counterpart. The one word it can be, so a report written
before there was a via reads as saying it.
Updated
The destination held a counterpart and it now reads as the source does.
Fields
Unchanged
The destination held a counterpart that already read that way; nothing was written.
Fields
Orphaned
The destination holds a counterpart the source no longer does. A copy never deletes, so it was left exactly as it is — and no rule was asked where it goes, and no link was touched, because it was not copied.
Implementations§
Source§impl CopyAction
impl CopyAction
Sourcepub fn destination(&self) -> Option<&GlobalId>
pub fn destination(&self) -> Option<&GlobalId>
The qualified id this action is about, when there is one.
Sourcepub fn found_by(&self) -> Option<CopyVia>
pub fn found_by(&self) -> Option<CopyVia>
Which rule found the counterpart, or None when none did — the item was created —
and for an orphan, which no rule was asked about.
Sourcepub fn link(&self) -> Option<CopyLink>
pub fn link(&self) -> Option<CopyLink>
What became of the copied item’s link, or None for a dry run and for an orphan.
Sourcepub fn name(&self) -> String
pub fn name(&self) -> String
The word this action serializes as, taken from its own Serialize.
Read back off the wire form rather than written out again in a match, for the
reason render::wire gives: a second spelling of unchanged would be a second
place for it to drift from the one a caller reads.
Trait Implementations§
Source§impl Clone for CopyAction
impl Clone for CopyAction
Source§impl Debug for CopyAction
impl Debug for CopyAction
Source§impl<'de> Deserialize<'de> for CopyAction
impl<'de> Deserialize<'de> for CopyAction
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 CopyAction
impl JsonSchema for CopyAction
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