Enum dot_parser::ast::Stmt
source · [−]pub enum Stmt<'a, A = (&'a str, &'a str)> {
NodeStmt(NodeStmt<'a, A>),
EdgeStmt(EdgeStmt<'a, A>),
AttrStmt(AttrStmt<'a, A>),
IDEq(&'a str, &'a str),
}Expand description
A statement of the graph. This corresponds to the stmt non-terminal of the
grammar.
Variants
NodeStmt(NodeStmt<'a, A>)
A node statement.
EdgeStmt(EdgeStmt<'a, A>)
An edge statement.
AttrStmt(AttrStmt<'a, A>)
An attribute statement.
IDEq(&'a str, &'a str)
An alias statement.
Implementations
sourceimpl<'a, A> Stmt<'a, A>
impl<'a, A> Stmt<'a, A>
sourcepub fn is_node_stmt(&self) -> bool
pub fn is_node_stmt(&self) -> bool
Returns true if self is a NodeStmt variant.
sourcepub fn get_node_ref(&self) -> Option<&NodeStmt<'_, A>>
pub fn get_node_ref(&self) -> Option<&NodeStmt<'_, A>>
Returns Some(&node) if &self if a &NodeStmt(node), and None
otherwise.
sourcepub fn get_node(self) -> Option<NodeStmt<'a, A>>
pub fn get_node(self) -> Option<NodeStmt<'a, A>>
Returns Some(node) if self if a NodeStmt(node), and None
otherwise.
sourcepub fn is_edge_stmt(&self) -> bool
pub fn is_edge_stmt(&self) -> bool
Returns true if self is a EdgeStmt variant.
sourcepub fn get_edge_ref(&self) -> Option<&EdgeStmt<'_, A>>
pub fn get_edge_ref(&self) -> Option<&EdgeStmt<'_, A>>
Returns Some(&edge) if &self if a &EdgeStmt(edge), and None
otherwise.
sourcepub fn get_edge(self) -> Option<EdgeStmt<'a, A>>
pub fn get_edge(self) -> Option<EdgeStmt<'a, A>>
Returns Some(edge) if self if a EdgeStmt(edge), and None
otherwise.
sourcepub fn is_attr_stmt(&self) -> bool
pub fn is_attr_stmt(&self) -> bool
Returns true if self is a AttrStmt variant.
sourcepub fn get_attr_ref(&self) -> Option<&AttrStmt<'_, A>>
pub fn get_attr_ref(&self) -> Option<&AttrStmt<'_, A>>
Returns Some(&attr) if &self if a &AttrStmt(attr), and None
otherwise.
sourcepub fn get_attr(self) -> Option<AttrStmt<'a, A>>
pub fn get_attr(self) -> Option<AttrStmt<'a, A>>
Returns Some(attr) if self if a AttrStmt(attr), and None
otherwise.
sourcepub fn is_ideq_stmt(&self) -> bool
pub fn is_ideq_stmt(&self) -> bool
Returns true if self is a IDEq variant.
sourcepub fn get_ideq_ref(&self) -> Option<(&str, &str)>
pub fn get_ideq_ref(&self) -> Option<(&str, &str)>
Returns Some((&id1, &id2)) if &self if a &IDEq(id1, id2) and None
otherwise.
Trait Implementations
sourceimpl<'a, A> FromIterator<Stmt<'a, A>> for StmtList<'a, A>
impl<'a, A> FromIterator<Stmt<'a, A>> for StmtList<'a, A>
sourcefn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = Stmt<'a, A>>,
fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = Stmt<'a, A>>,
Creates a value from an iterator. Read more
sourceimpl<'a, A: Ord> Ord for Stmt<'a, A>
impl<'a, A: Ord> Ord for Stmt<'a, A>
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<'a, A: PartialEq> PartialEq<Stmt<'a, A>> for Stmt<'a, A>
impl<'a, A: PartialEq> PartialEq<Stmt<'a, A>> for Stmt<'a, A>
sourceimpl<'a, A: PartialOrd> PartialOrd<Stmt<'a, A>> for Stmt<'a, A>
impl<'a, A: PartialOrd> PartialOrd<Stmt<'a, A>> for Stmt<'a, A>
sourcefn partial_cmp(&self, other: &Stmt<'a, A>) -> Option<Ordering>
fn partial_cmp(&self, other: &Stmt<'a, A>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'a, A: Eq> Eq for Stmt<'a, A>
impl<'a, A> StructuralEq for Stmt<'a, A>
impl<'a, A> StructuralPartialEq for Stmt<'a, A>
Auto Trait Implementations
impl<'a, A> RefUnwindSafe for Stmt<'a, A>where
A: RefUnwindSafe,
impl<'a, A> Send for Stmt<'a, A>where
A: Send,
impl<'a, A> Sync for Stmt<'a, A>where
A: Sync,
impl<'a, A> Unpin for Stmt<'a, A>where
A: Unpin,
impl<'a, A> UnwindSafe for Stmt<'a, A>where
A: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more