Skip to main content

Graph

Struct Graph 

Source
pub struct Graph<C = (), O = ()> { /* private fields */ }
Expand description

Trellis graph skeleton with transactional input mutation.

Implementations§

Source§

impl<C, O> Graph<C, O>

Source

pub fn audit_log(&self) -> &[AuditEntry]

Returns the committed audit log.

Source

pub fn why_changed<H: NodeHandle>( &self, node: H, ) -> Option<&NodeChangeExplanation>

Explains why a typed node last changed.

Source

pub fn why_changed_by_id(&self, node: NodeId) -> Option<&NodeChangeExplanation>

Explains why a node id last changed.

Source

pub fn why_resource_command( &self, key: &ResourceKey, ) -> Option<&ResourceCommandExplanation>

Explains the latest resource command for a resource key.

Source

pub fn why_output_frame( &self, key: OutputKey, ) -> Option<&OutputFrameExplanation>

Explains the latest output frame for an output key.

Source

pub fn dependency_path(&self, from: NodeId, to: NodeId) -> Option<Vec<NodeId>>

Returns a dependency path from an upstream node to a downstream node.

Source

pub fn scope_resource_inventory( &self, scope: ScopeId, ) -> GraphResult<ScopeResourceInventory>

Returns resources currently owned by a scope.

Source§

impl<C, O> Graph<C, O>

Source

pub fn debug_dump(&self) -> String

Returns a deterministic text dump of graph metadata.

Source§

impl<C, O> Graph<C, O>

Source

pub fn new_with_command_type() -> Self

Creates an empty graph.

Source

pub fn revision(&self) -> Revision

Returns the graph revision.

Source

pub fn begin_transaction(&mut self) -> GraphResult<Transaction<'_, C, O>>
where O: Clone + PartialEq,

Begins an input transaction with default options.

Source

pub fn begin_transaction_with_options( &mut self, options: TransactionOptions, ) -> GraphResult<Transaction<'_, C, O>>
where O: Clone + PartialEq,

Begins an input transaction with explicit options.

Source

pub fn node_meta<H: NodeHandle>(&self, node: H) -> Option<&NodeMeta>

Returns metadata for a node.

Source

pub fn node_meta_by_id(&self, id: NodeId) -> Option<&NodeMeta>

Returns metadata for a node id.

Source

pub fn scope_meta(&self, id: ScopeId) -> Option<&ScopeMeta>

Returns metadata for a scope.

Source

pub fn output_meta(&self, key: OutputKey) -> Option<&OutputMeta>

Returns metadata for a materialized output.

Source

pub fn dependencies<H: NodeHandle>(&self, node: H) -> Option<&DependencyList>

Returns declared dependencies for a node.

Source

pub fn nodes(&self) -> impl Iterator<Item = &NodeMeta>

Returns all node metadata in stable id order.

Source

pub fn scopes(&self) -> impl Iterator<Item = &ScopeMeta>

Returns all scope metadata in stable id order.

Source§

impl Graph<(), ()>

Source

pub fn new() -> Self

Creates an empty graph with no resource command payload type.

Source§

impl<O> Graph<(), O>

Source

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>

Source

pub fn full_recompute(&self) -> GraphResult<FullRecomputeCheck>
where O: PartialEq,

Recomputes supported graph state from canonical inputs and compares it.

Source

pub fn assert_incremental_equals_full(&self) -> GraphResult<FullRecomputeCheck>
where O: PartialEq,

Asserts that incremental state equals a supported full recompute.

Source

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>

Source

pub fn input_value<T>(&self, input: InputNode<T>) -> GraphResult<Option<&T>>
where T: Clone + PartialEq + Send + Sync + 'static,

Returns the committed value for a typed input node.

Source

pub fn input_value_by_id<T>(&self, node: NodeId) -> GraphResult<Option<&T>>
where T: Clone + PartialEq + Send + Sync + 'static,

Returns the committed value for an input node id.

Source

pub fn derived_value<T>( &self, derived: DerivedNode<T>, ) -> GraphResult<Option<&T>>
where T: Clone + PartialEq + Send + Sync + 'static,

Returns the committed value for a typed derived node.

Source

pub fn derived_value_by_id<T>(&self, node: NodeId) -> GraphResult<Option<&T>>
where T: Clone + PartialEq + Send + Sync + 'static,

Returns the committed value for a derived node id.

Source

pub fn map_collection<K, V>( &self, collection: CollectionNode<K, V>, ) -> GraphResult<Option<&BTreeMap<K, V>>>
where K: Clone + Ord + Send + Sync + 'static, V: Clone + PartialEq + Send + Sync + 'static,

Returns the committed map for a collection node.

Source

pub fn set_collection<K>( &self, collection: CollectionNode<K, ()>, ) -> GraphResult<Option<&BTreeSet<K>>>
where K: Clone + Ord + Send + Sync + 'static,

Returns the committed set for a collection node.

Source

pub fn map_diff<K, V>( &self, collection: CollectionNode<K, V>, ) -> GraphResult<Option<&MapDiff<K, V>>>
where K: Clone + Ord + Send + Sync + 'static, V: Clone + PartialEq + Send + Sync + 'static,

Returns the last committed map diff for the current transaction.

Source

pub fn set_diff<K>( &self, collection: CollectionNode<K, ()>, ) -> GraphResult<Option<&SetDiff<K>>>
where K: Clone + Ord + Send + Sync + 'static,

Returns the last committed set diff for the current transaction.

Source

pub fn map_collection_by_id<K, V>( &self, node: NodeId, ) -> GraphResult<Option<&BTreeMap<K, V>>>
where K: Clone + Ord + Send + Sync + 'static, V: Clone + PartialEq + Send + Sync + 'static,

Returns the committed map for a collection node id.

Source

pub fn set_collection_by_id<K>( &self, node: NodeId, ) -> GraphResult<Option<&BTreeSet<K>>>
where K: Clone + Ord + Send + Sync + 'static,

Returns the committed set for a collection node id.

Source

pub fn map_diff_by_id<K, V>( &self, node: NodeId, ) -> GraphResult<Option<&MapDiff<K, V>>>
where K: Clone + Ord + Send + Sync + 'static, V: Clone + PartialEq + Send + Sync + 'static,

Returns the current transaction’s map diff for a collection node id.

Source

pub fn set_diff_by_id<K>( &self, node: NodeId, ) -> GraphResult<Option<&SetDiff<K>>>
where K: Clone + Ord + Send + Sync + 'static,

Returns the current transaction’s set diff for a collection node id.

Source§

impl<C, O> Graph<C, O>

Source

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>

Source

pub fn child_scopes(&self, scope: ScopeId) -> GraphResult<Vec<ScopeId>>

Returns child scopes in stable id order.

Source

pub fn orphan_resources(&self) -> Vec<ResourceKey>

Returns resources whose owner set is empty or contains no live scope.

Trait Implementations§

Source§

impl<C, O: Clone> Clone for Graph<C, O>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C, O> Default for Graph<C, O>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<C = (), O = ()> !RefUnwindSafe for Graph<C, O>

§

impl<C = (), O = ()> !UnwindSafe for Graph<C, O>

§

impl<C, O> Freeze for Graph<C, O>

§

impl<C, O> Send for Graph<C, O>
where O: Send,

§

impl<C, O> Sync for Graph<C, O>
where O: Sync,

§

impl<C, O> Unpin for Graph<C, O>

§

impl<C, O> UnsafeUnpin for Graph<C, O>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.