Skip to main content

LambdaEdges

Struct LambdaEdges 

Source
pub struct LambdaEdges<V> { /* private fields */ }
Expand description

Identity-keyed store of per-edge Λ decoration slots for one causal graph.

Keys are (source, target) node-index pairs — the intrinsic identity of a directed edge in the graph — so which Λ applies to which input of a join is independent of any enumeration order. Absent key = identity Λ (see LambdaEdges::apply).

Implementations§

Source§

impl<V> LambdaEdges<V>

Source

pub fn new() -> Self

Creates an empty decoration store: every edge is the identity Λ.

Source

pub fn insert( &mut self, source: usize, target: usize, lambda: EdgeLambdaFn<V>, ) -> Option<EdgeLambdaFn<V>>

Sets the Λ slot for the edge source -> target, returning the previously stored Λ if the slot was already decorated.

Source

pub fn with_lambda( self, source: usize, target: usize, lambda: EdgeLambdaFn<V>, ) -> Self

Builder form of LambdaEdges::insert.

Source

pub fn get(&self, source: usize, target: usize) -> Option<EdgeLambdaFn<V>>

Looks up the Λ slot of the edge source -> target by its intrinsic identity. None means the edge is undecorated (identity Λ).

Source

pub fn apply(&self, source: usize, target: usize, value: V) -> V

Applies the edge’s Λ to a value: the stored transform if the edge is decorated, the identity otherwise — the “undecorated edge behaves as the identity Λ” contract.

Source

pub fn len(&self) -> usize

Number of decorated edges.

Source

pub fn is_empty(&self) -> bool

True when no edge is decorated (the whole graph is identity-Λ).

Trait Implementations§

Source§

impl<V> Clone for LambdaEdges<V>

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<V> Debug for LambdaEdges<V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<V> Default for LambdaEdges<V>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<V> Freeze for LambdaEdges<V>
where BTreeMap<(usize, usize), fn(V) -> V>: Freeze,

§

impl<V> RefUnwindSafe for LambdaEdges<V>
where BTreeMap<(usize, usize), fn(V) -> V>: RefUnwindSafe,

§

impl<V> Send for LambdaEdges<V>
where BTreeMap<(usize, usize), fn(V) -> V>: Send,

§

impl<V> Sync for LambdaEdges<V>
where BTreeMap<(usize, usize), fn(V) -> V>: Sync,

§

impl<V> Unpin for LambdaEdges<V>
where BTreeMap<(usize, usize), fn(V) -> V>: Unpin,

§

impl<V> UnsafeUnpin for LambdaEdges<V>
where BTreeMap<(usize, usize), fn(V) -> V>: UnsafeUnpin,

§

impl<V> UnwindSafe for LambdaEdges<V>
where BTreeMap<(usize, usize), fn(V) -> V>: UnwindSafe,

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> Satisfies<NoConstraint> for T

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 = !

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.