Struct dfir_lang::graph::FlatGraphBuilder
source · pub struct FlatGraphBuilder { /* private fields */ }
Expand description
Wraper around DfirGraph
to build a flat graph from AST code.
Implementations§
source§impl FlatGraphBuilder
impl FlatGraphBuilder
sourcepub fn from_hfcode(input: HfCode) -> Self
pub fn from_hfcode(input: HfCode) -> Self
Convert the Hydroflow code AST into a graph builder.
sourcepub fn build(self) -> (DfirGraph, Vec<ItemUse>, Vec<Diagnostic>)
pub fn build(self) -> (DfirGraph, Vec<ItemUse>, Vec<Diagnostic>)
Build into an unpartitioned DfirGraph
, returning a tuple of a HydroflowGraph
and
any diagnostics.
Even if there are errors, the HydroflowGraph
will be returned (potentially in a invalid
state). Does not call emit
on any diagnostics.
sourcepub fn add_statement(&mut self, stmt: HfStatement)
pub fn add_statement(&mut self, stmt: HfStatement)
Add a single HfStatement
line to this HydroflowGraph
in the root context.
sourcepub fn add_statement_with_loop(
&mut self,
stmt: HfStatement,
current_loop: Option<GraphLoopId>,
)
pub fn add_statement_with_loop( &mut self, stmt: HfStatement, current_loop: Option<GraphLoopId>, )
Add a single HfStatement
line to this HydroflowGraph
in the given loop context.
Trait Implementations§
source§impl Debug for FlatGraphBuilder
impl Debug for FlatGraphBuilder
source§impl Default for FlatGraphBuilder
impl Default for FlatGraphBuilder
source§fn default() -> FlatGraphBuilder
fn default() -> FlatGraphBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FlatGraphBuilder
impl !RefUnwindSafe for FlatGraphBuilder
impl !Send for FlatGraphBuilder
impl !Sync for FlatGraphBuilder
impl Unpin for FlatGraphBuilder
impl !UnwindSafe for FlatGraphBuilder
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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