pub enum EdgeType {
None,
Subject,
Assertion,
Predicate,
Object,
Content,
}Expand description
The type of incoming edge provided to the visitor.
This enum identifies how an envelope element is connected to its parent in the hierarchy during traversal. It helps the visitor function understand the semantic relationship between elements.
Each edge type represents a specific relationship within the envelope structure:
None: Root or no connectionSubject: Element is the subject of its parent nodeAssertion: Element is an assertion on its parent nodePredicate: Element is the predicate of an assertionObject: Element is the object of an assertionWrapped: Element is wrapped by its parent
Variants§
None
No incoming edge (root)
Subject
Element is the subject of a node
Assertion
Element is an assertion on a node
Predicate
Element is the predicate of an assertion
Object
Element is the object of an assertion
Content
Element is the content wrapped by another envelope
Implementations§
Source§impl EdgeType
Provides a label for the edge type in tree formatting.
impl EdgeType
Provides a label for the edge type in tree formatting.
Sourcepub fn label(&self) -> Option<&'static str>
pub fn label(&self) -> Option<&'static str>
Returns a short text label for the edge type, or None if no label is needed.
This is primarily used for tree formatting to identify relationships between elements.
§Examples
assert_eq!(EdgeType::Subject.label(), Some("subj"));
assert_eq!(EdgeType::Content.label(), Some("cont"));
assert_eq!(EdgeType::Predicate.label(), Some("pred"));
assert_eq!(EdgeType::Object.label(), Some("obj"));
assert_eq!(EdgeType::Assertion.label(), None);Trait Implementations§
impl Copy for EdgeType
impl Eq for EdgeType
impl StructuralPartialEq for EdgeType
Auto Trait Implementations§
impl Freeze for EdgeType
impl RefUnwindSafe for EdgeType
impl Send for EdgeType
impl Sync for EdgeType
impl Unpin for EdgeType
impl UnwindSafe for EdgeType
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more