pub struct GraphEngine { /* private fields */ }Expand description
The reactive dependency graph engine.
Implementations§
Source§impl GraphEngine
impl GraphEngine
Sourcepub fn add_cell(&mut self, cell: CellInfo) -> CellId
pub fn add_cell(&mut self, cell: CellInfo) -> CellId
Add a cell to the graph (first pass: collect cells).
Sourcepub fn resolve_dependencies(&mut self) -> Result<()>
pub fn resolve_dependencies(&mut self) -> Result<()>
Resolve dependencies and build edges (second pass).
Sourcepub fn topological_order(&self) -> Result<Vec<CellId>>
pub fn topological_order(&self) -> Result<Vec<CellId>>
Get cells in topological order (respecting dependencies).
Sourcepub fn invalidated_cells(&self, changed: CellId) -> Vec<CellId>
pub fn invalidated_cells(&self, changed: CellId) -> Vec<CellId>
Get cells that need re-execution when changed is modified.
Returns the changed cell plus all its transitive dependents, in topological order.
Sourcepub fn topological_levels(&self, cells: &[CellId]) -> Vec<Vec<CellId>>
pub fn topological_levels(&self, cells: &[CellId]) -> Vec<Vec<CellId>>
Group cells by dependency level for parallel execution.
Cells in the same level have no dependencies on each other and can be executed in parallel.
Sourcepub fn get_cell_by_name(&self, name: &str) -> Option<&CellInfo>
pub fn get_cell_by_name(&self, name: &str) -> Option<&CellInfo>
Get a cell by name.
Sourcepub fn dependencies(&self, id: CellId) -> Vec<CellId>
pub fn dependencies(&self, id: CellId) -> Vec<CellId>
Get direct dependencies of a cell.
Sourcepub fn dependents(&self, id: CellId) -> Vec<CellId>
pub fn dependents(&self, id: CellId) -> Vec<CellId>
Get direct dependents of a cell (cells that depend on this one).
Sourcepub fn add_definition_cell(&mut self, cell: DefinitionCell) -> CellId
pub fn add_definition_cell(&mut self, cell: DefinitionCell) -> CellId
Add a definition cell to the graph.
Sourcepub fn get_definition_cell(&self, id: CellId) -> Option<&DefinitionCell>
pub fn get_definition_cell(&self, id: CellId) -> Option<&DefinitionCell>
Get a definition cell by ID.
Sourcepub fn get_definition_cell_mut(
&mut self,
id: CellId,
) -> Option<&mut DefinitionCell>
pub fn get_definition_cell_mut( &mut self, id: CellId, ) -> Option<&mut DefinitionCell>
Get a mutable reference to a definition cell by ID.
Sourcepub fn definition_cells(&self) -> impl Iterator<Item = &DefinitionCell>
pub fn definition_cells(&self) -> impl Iterator<Item = &DefinitionCell>
Get all definition cells.
Sourcepub fn remove_definition_cell(&mut self, id: CellId) -> Option<DefinitionCell>
pub fn remove_definition_cell(&mut self, id: CellId) -> Option<DefinitionCell>
Remove a definition cell by ID.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphEngine
impl RefUnwindSafe for GraphEngine
impl Send for GraphEngine
impl Sync for GraphEngine
impl Unpin for GraphEngine
impl UnwindSafe for GraphEngine
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.