Operation

Enum Operation 

Source
pub enum Operation<I, O, C, N>
where I: Default + Clone, O: Default + Clone + Debug, C: Clone, N: Clone,
{ CreateCausaloid(CausaloidId, Causaloid<I, O, (), Arc<RwLock<C>>>), UpdateCausaloid(CausaloidId, Causaloid<I, O, (), Arc<RwLock<C>>>), DeleteCausaloid(CausaloidId), CreateContext { id: ContextId, name: String, capacity: usize, }, CreateExtraContext { context_id: ContextId, extra_context_id: u64, capacity: usize, }, UpdateContext { id: ContextId, new_name: Option<String>, }, DeleteContext(ContextId), AddContextoidToContext { context_id: ContextId, contextoid: N, }, UpdateContextoidInContext { context_id: ContextId, existing_contextoid: ContextoidId, new_contextoid: N, }, DeleteContextoidFromContext { context_id: ContextId, contextoid_id: ContextoidId, }, Sequence, NoOp, }
Expand description

Represents all possible operations that can be applied to a causal model.

This enum provides a declarative way to specify model transformations. Each variant represents a primitive operation that can be executed by the Interpreter.

§Type Parameters

  • I: Input effect value type
  • O: Output effect value type
  • C: Context type (e.g., Context)
  • N: Node type (e.g., Contextoid)

Variants§

§

CreateCausaloid(CausaloidId, Causaloid<I, O, (), Arc<RwLock<C>>>)

Creates a new causaloid with the specified ID.

§Fields

  • CausaloidId: Unique identifier for the causaloid
  • Causaloid: The causaloid instance to create
§

UpdateCausaloid(CausaloidId, Causaloid<I, O, (), Arc<RwLock<C>>>)

Updates an existing causaloid, replacing it with a new instance.

§Fields

  • CausaloidId: ID of the causaloid to update
  • Causaloid: New causaloid instance
§

DeleteCausaloid(CausaloidId)

Deletes a causaloid by its ID.

§Fields

  • CausaloidId: ID of the causaloid to delete
§

CreateContext

Creates a new base context.

§Fields

  • id: Unique identifier for the context
  • name: Human-readable name
  • capacity: Initial capacity for the context graph

Fields

§name: String
§capacity: usize
§

CreateExtraContext

Creates an extra context within an existing context.

§Fields

  • context_id: ID of the parent context
  • extra_context_id: ID for the new extra context
  • capacity: Initial capacity for the extra context

Fields

§context_id: ContextId
§extra_context_id: u64
§capacity: usize
§

UpdateContext

Updates properties of an existing context.

§Fields

  • id: ID of the context to update
  • new_name: Optional new name for the context

Fields

§new_name: Option<String>
§

DeleteContext(ContextId)

Deletes a context by its ID.

§Fields

  • ContextId: ID of the context to delete
§

AddContextoidToContext

Adds a node (contextoid) to a context’s graph.

§Fields

  • context_id: ID of the target context
  • contextoid: The node to add

Fields

§context_id: ContextId
§contextoid: N
§

UpdateContextoidInContext

Updates an existing node (contextoid) within a context.

§Fields

  • context_id: ID of the containing context
  • existing_contextoid: ID of the node to replace
  • new_contextoid: New node instance

Fields

§context_id: ContextId
§existing_contextoid: ContextoidId
§new_contextoid: N
§

DeleteContextoidFromContext

Deletes a node (contextoid) from a context’s graph.

§Fields

  • context_id: ID of the containing context
  • contextoid_id: ID of the node to delete

Fields

§context_id: ContextId
§contextoid_id: ContextoidId
§

Sequence

Control flow: Execute all child operations in sequence.

Fails if any child operation fails. Used as a root or intermediate node in an OpTree to compose multiple operations.

§

NoOp

No operation. Useful as a placeholder or for conditional logic.

Trait Implementations§

Source§

impl<I, O, C, N> Clone for Operation<I, O, C, N>
where I: Default + Clone + Clone, O: Default + Clone + Debug + Clone, C: Clone + Clone, N: Clone + Clone,

Source§

fn clone(&self) -> Operation<I, O, C, N>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<I, O, C, N> Debug for Operation<I, O, C, N>
where I: Default + Clone + Debug, O: Default + Clone + Debug + Debug, C: Clone + Debug, N: Clone + Debug,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<I, O, C, N> Freeze for Operation<I, O, C, N>
where N: Freeze,

§

impl<I, O, C, N> RefUnwindSafe for Operation<I, O, C, N>

§

impl<I, O, C, N> Send for Operation<I, O, C, N>
where N: Send, I: Send + Sync, O: Send + Sync, C: Send + Sync,

§

impl<I, O, C, N> Sync for Operation<I, O, C, N>
where N: Sync, I: Sync + Send, O: Sync + Send, C: Send + Sync,

§

impl<I, O, C, N> Unpin for Operation<I, O, C, N>
where N: Unpin, I: Unpin, O: Unpin,

§

impl<I, O, C, N> UnwindSafe for Operation<I, O, C, N>

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.