pub enum Stmt<A> {
NodeStmt(NodeStmt<A>),
EdgeStmt(EdgeStmt<A>),
AttrStmt(AttrStmt<A>),
IDEq(String, String),
Subgraph(Subgraph<A>),
}
Expand description
A statement of the graph. This corresponds to the stmt
non-terminal of the
grammar.
Variants§
NodeStmt(NodeStmt<A>)
A node statement.
EdgeStmt(EdgeStmt<A>)
An edge statement.
AttrStmt(AttrStmt<A>)
An attribute statement.
IDEq(String, String)
An alias statement.
Subgraph(Subgraph<A>)
A subgraph.
Implementations§
Source§impl<'a, A> Stmt<A>
impl<'a, A> Stmt<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>>
pub fn get_node(self) -> Option<NodeStmt<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>>
pub fn get_edge(self) -> Option<EdgeStmt<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>>
pub fn get_attr(self) -> Option<AttrStmt<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.
Sourcepub fn is_subgraph(&self) -> bool
pub fn is_subgraph(&self) -> bool
Returns true
if self
is a Subgraph
variant.
Trait Implementations§
Source§impl<A> FromIterator<Stmt<A>> for StmtList<A>
impl<A> FromIterator<Stmt<A>> for StmtList<A>
Source§impl<A: Ord> Ord for Stmt<A>
impl<A: Ord> Ord for Stmt<A>
Source§impl<A: PartialOrd> PartialOrd for Stmt<A>
impl<A: PartialOrd> PartialOrd for Stmt<A>
Source§impl<'a, A> TryFrom<Pair<'a, Rule>> for Stmt<A>
impl<'a, A> TryFrom<Pair<'a, Rule>> for Stmt<A>
Source§type Error = ParseError<'a>
type Error = ParseError<'a>
impl<A: Eq> Eq for Stmt<A>
impl<A> StructuralPartialEq for Stmt<A>
Auto Trait Implementations§
impl<A> Freeze for Stmt<A>
impl<A> RefUnwindSafe for Stmt<A>where
A: RefUnwindSafe,
impl<A> Send for Stmt<A>where
A: Send,
impl<A> Sync for Stmt<A>where
A: Sync,
impl<A> Unpin for Stmt<A>where
A: Unpin,
impl<A> UnwindSafe for Stmt<A>where
A: UnwindSafe,
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