pub struct Graph<C = (), O = ()> { /* private fields */ }Expand description
Trellis graph skeleton with transactional input mutation.
Implementations§
Source§impl<C, O> Graph<C, O>
impl<C, O> Graph<C, O>
Sourcepub fn audit_log(&self) -> &[AuditEntry]
pub fn audit_log(&self) -> &[AuditEntry]
Returns the committed audit log.
Sourcepub fn why_changed<H: NodeHandle>(
&self,
node: H,
) -> Option<&NodeChangeExplanation>
pub fn why_changed<H: NodeHandle>( &self, node: H, ) -> Option<&NodeChangeExplanation>
Explains why a typed node last changed.
Sourcepub fn why_changed_by_id(&self, node: NodeId) -> Option<&NodeChangeExplanation>
pub fn why_changed_by_id(&self, node: NodeId) -> Option<&NodeChangeExplanation>
Explains why a node id last changed.
Sourcepub fn why_resource_command(
&self,
key: &ResourceKey,
) -> Option<&ResourceCommandExplanation>
pub fn why_resource_command( &self, key: &ResourceKey, ) -> Option<&ResourceCommandExplanation>
Explains the latest resource command for a resource key.
Sourcepub fn why_output_frame(
&self,
key: OutputKey,
) -> Option<&OutputFrameExplanation>
pub fn why_output_frame( &self, key: OutputKey, ) -> Option<&OutputFrameExplanation>
Explains the latest output frame for an output key.
Sourcepub fn dependency_path(&self, from: NodeId, to: NodeId) -> Option<Vec<NodeId>>
pub fn dependency_path(&self, from: NodeId, to: NodeId) -> Option<Vec<NodeId>>
Returns a dependency path from an upstream node to a downstream node.
Sourcepub fn scope_resource_inventory(
&self,
scope: ScopeId,
) -> GraphResult<ScopeResourceInventory>
pub fn scope_resource_inventory( &self, scope: ScopeId, ) -> GraphResult<ScopeResourceInventory>
Returns resources currently owned by a scope.
Source§impl<C, O> Graph<C, O>
impl<C, O> Graph<C, O>
Sourcepub fn debug_dump(&self) -> String
pub fn debug_dump(&self) -> String
Returns a deterministic text dump of graph metadata.
Source§impl<C, O> Graph<C, O>
impl<C, O> Graph<C, O>
Sourcepub fn new_with_command_type() -> Self
pub fn new_with_command_type() -> Self
Creates an empty graph.
Sourcepub fn begin_transaction(&mut self) -> GraphResult<Transaction<'_, C, O>>
pub fn begin_transaction(&mut self) -> GraphResult<Transaction<'_, C, O>>
Begins an input transaction with default options.
Sourcepub fn begin_transaction_with_options(
&mut self,
options: TransactionOptions,
) -> GraphResult<Transaction<'_, C, O>>
pub fn begin_transaction_with_options( &mut self, options: TransactionOptions, ) -> GraphResult<Transaction<'_, C, O>>
Begins an input transaction with explicit options.
Sourcepub fn node_meta<H: NodeHandle>(&self, node: H) -> Option<&NodeMeta>
pub fn node_meta<H: NodeHandle>(&self, node: H) -> Option<&NodeMeta>
Returns metadata for a node.
Sourcepub fn node_meta_by_id(&self, id: NodeId) -> Option<&NodeMeta>
pub fn node_meta_by_id(&self, id: NodeId) -> Option<&NodeMeta>
Returns metadata for a node id.
Sourcepub fn scope_meta(&self, id: ScopeId) -> Option<&ScopeMeta>
pub fn scope_meta(&self, id: ScopeId) -> Option<&ScopeMeta>
Returns metadata for a scope.
Sourcepub fn output_meta(&self, key: OutputKey) -> Option<&OutputMeta>
pub fn output_meta(&self, key: OutputKey) -> Option<&OutputMeta>
Returns metadata for a materialized output.
Sourcepub fn dependencies<H: NodeHandle>(&self, node: H) -> Option<&DependencyList>
pub fn dependencies<H: NodeHandle>(&self, node: H) -> Option<&DependencyList>
Returns declared dependencies for a node.
Source§impl<O> Graph<(), O>
impl<O> Graph<(), O>
Sourcepub fn new_with_output_type() -> Self
pub fn new_with_output_type() -> Self
Creates an empty graph with a materialized output payload type.
Source§impl<C, O: Clone> Graph<C, O>
impl<C, O: Clone> Graph<C, O>
Sourcepub fn full_recompute(&self) -> GraphResult<FullRecomputeCheck>where
O: PartialEq,
pub fn full_recompute(&self) -> GraphResult<FullRecomputeCheck>where
O: PartialEq,
Recomputes supported graph state from canonical inputs and compares it.
Sourcepub fn assert_incremental_equals_full(&self) -> GraphResult<FullRecomputeCheck>where
O: PartialEq,
pub fn assert_incremental_equals_full(&self) -> GraphResult<FullRecomputeCheck>where
O: PartialEq,
Asserts that incremental state equals a supported full recompute.
Sourcepub fn full_recompute_check(&self) -> GraphResult<FullRecomputeCheck>where
O: PartialEq,
pub fn full_recompute_check(&self) -> GraphResult<FullRecomputeCheck>where
O: PartialEq,
Compares committed incremental state against full recompute.
Source§impl<C, O> Graph<C, O>
impl<C, O> Graph<C, O>
Sourcepub fn input_value<T>(&self, input: InputNode<T>) -> GraphResult<Option<&T>>
pub fn input_value<T>(&self, input: InputNode<T>) -> GraphResult<Option<&T>>
Returns the committed value for a typed input node.
Sourcepub fn input_value_by_id<T>(&self, node: NodeId) -> GraphResult<Option<&T>>
pub fn input_value_by_id<T>(&self, node: NodeId) -> GraphResult<Option<&T>>
Returns the committed value for an input node id.
Sourcepub fn derived_value<T>(
&self,
derived: DerivedNode<T>,
) -> GraphResult<Option<&T>>
pub fn derived_value<T>( &self, derived: DerivedNode<T>, ) -> GraphResult<Option<&T>>
Returns the committed value for a typed derived node.
Sourcepub fn derived_value_by_id<T>(&self, node: NodeId) -> GraphResult<Option<&T>>
pub fn derived_value_by_id<T>(&self, node: NodeId) -> GraphResult<Option<&T>>
Returns the committed value for a derived node id.
Sourcepub fn map_collection<K, V>(
&self,
collection: CollectionNode<K, V>,
) -> GraphResult<Option<&BTreeMap<K, V>>>
pub fn map_collection<K, V>( &self, collection: CollectionNode<K, V>, ) -> GraphResult<Option<&BTreeMap<K, V>>>
Returns the committed map for a collection node.
Sourcepub fn set_collection<K>(
&self,
collection: CollectionNode<K, ()>,
) -> GraphResult<Option<&BTreeSet<K>>>
pub fn set_collection<K>( &self, collection: CollectionNode<K, ()>, ) -> GraphResult<Option<&BTreeSet<K>>>
Returns the committed set for a collection node.
Sourcepub fn map_diff<K, V>(
&self,
collection: CollectionNode<K, V>,
) -> GraphResult<Option<&MapDiff<K, V>>>
pub fn map_diff<K, V>( &self, collection: CollectionNode<K, V>, ) -> GraphResult<Option<&MapDiff<K, V>>>
Returns the last committed map diff for the current transaction.
Sourcepub fn set_diff<K>(
&self,
collection: CollectionNode<K, ()>,
) -> GraphResult<Option<&SetDiff<K>>>
pub fn set_diff<K>( &self, collection: CollectionNode<K, ()>, ) -> GraphResult<Option<&SetDiff<K>>>
Returns the last committed set diff for the current transaction.
Sourcepub fn map_collection_by_id<K, V>(
&self,
node: NodeId,
) -> GraphResult<Option<&BTreeMap<K, V>>>
pub fn map_collection_by_id<K, V>( &self, node: NodeId, ) -> GraphResult<Option<&BTreeMap<K, V>>>
Returns the committed map for a collection node id.
Sourcepub fn set_collection_by_id<K>(
&self,
node: NodeId,
) -> GraphResult<Option<&BTreeSet<K>>>
pub fn set_collection_by_id<K>( &self, node: NodeId, ) -> GraphResult<Option<&BTreeSet<K>>>
Returns the committed set for a collection node id.
Sourcepub fn map_diff_by_id<K, V>(
&self,
node: NodeId,
) -> GraphResult<Option<&MapDiff<K, V>>>
pub fn map_diff_by_id<K, V>( &self, node: NodeId, ) -> GraphResult<Option<&MapDiff<K, V>>>
Returns the current transaction’s map diff for a collection node id.
Sourcepub fn set_diff_by_id<K>(
&self,
node: NodeId,
) -> GraphResult<Option<&SetDiff<K>>>
pub fn set_diff_by_id<K>( &self, node: NodeId, ) -> GraphResult<Option<&SetDiff<K>>>
Returns the current transaction’s set diff for a collection node id.
Source§impl<C, O> Graph<C, O>
impl<C, O> Graph<C, O>
Sourcepub fn resource_owners(&self, key: &ResourceKey) -> Option<&BTreeSet<ScopeId>>
pub fn resource_owners(&self, key: &ResourceKey) -> Option<&BTreeSet<ScopeId>>
Returns resource owners in deterministic resource-key order.
Source§impl<C, O> Graph<C, O>
impl<C, O> Graph<C, O>
Sourcepub fn child_scopes(&self, scope: ScopeId) -> GraphResult<Vec<ScopeId>>
pub fn child_scopes(&self, scope: ScopeId) -> GraphResult<Vec<ScopeId>>
Returns child scopes in stable id order.
Sourcepub fn orphan_resources(&self) -> Vec<ResourceKey>
pub fn orphan_resources(&self) -> Vec<ResourceKey>
Returns resources whose owner set is empty or contains no live scope.