#[non_exhaustive]pub struct Edge {
pub from: String,
pub to: String,
pub path: String,
pub kind: Option<EdgeKind>,
pub basis: Option<KindBasis>,
pub by_value: bool,
}Expand description
One reference, from the object holding it to the object it names.
Built with Edge::new; #[non_exhaustive], so that what ETP adds to an
edge is not a breaking change for every caller.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.from: StringURI of the object holding the reference.
to: StringURI of the object it names.
path: StringWhere inside the source: Grid2dPatch.SupportingRepresentation.
kind: Option<EdgeKind>ETP RelationshipKind: whether the reference is primary or secondary -
what navigableEdges filters on. None when no rule gives it: an ETP
server states it; a store deriving its edges applies the rules of
crate::kinds, which refuse by name (basis is then
KindBasis::Unknown) where the specification is silent. Never guessed.
basis: Option<KindBasis>Where kind comes from: stated by a server, a rule of the ETP
specification, or this crate’s derivation, each labelled. None for an
edge nobody has judged (a reference as written, Edge::new).
by_value: boolWhether this is a by-value containment (the contained object is the source, its direct container the target; ETP 1.2 section 8.1.1.1.1, p. 156) and not a reference written in the source. It has no path.
Implementations§
Source§impl Edge
impl Edge
Sourcepub fn new(
from: impl Into<String>,
to: impl Into<String>,
path: impl Into<String>,
) -> Self
pub fn new( from: impl Into<String>, to: impl Into<String>, path: impl Into<String>, ) -> Self
A reference whose kind is not stated.
Sourcepub fn with_kind(self, kind: EdgeKind) -> Self
pub fn with_kind(self, kind: EdgeKind) -> Self
With the kind a server states (KindBasis::Stated).
Sourcepub fn with_judgement(self, judged: Judged) -> Self
pub fn with_judgement(self, judged: Judged) -> Self
With the kind the rules of crate::kinds give it, and what that rests on.
A judgement without a kind leaves the edge unkinded and records why.
Sourcepub fn contained(self) -> Self
pub fn contained(self) -> Self
As a by-value containment (Edge::by_value).
Trait Implementations§
impl Eq for Edge
impl StructuralPartialEq for Edge
Auto Trait Implementations§
impl Freeze for Edge
impl RefUnwindSafe for Edge
impl Send for Edge
impl Sync for Edge
impl Unpin for Edge
impl UnsafeUnpin for Edge
impl UnwindSafe for Edge
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.