CircuitEvent

Enum CircuitEvent 

Source
pub enum CircuitEvent {
    PushRegion {
        name: Cow<'static, str>,
        location: OperatorLocation,
    },
    PopRegion,
    Operator {
        node_id: GlobalNodeId,
        name: Cow<'static, str>,
        location: OperatorLocation,
    },
    StrictOperatorOutput {
        node_id: GlobalNodeId,
        name: Cow<'static, str>,
        location: OperatorLocation,
    },
    StrictOperatorInput {
        node_id: GlobalNodeId,
        output_node_id: NodeId,
    },
    Subcircuit {
        node_id: GlobalNodeId,
        iterative: bool,
    },
    SubcircuitComplete {
        node_id: GlobalNodeId,
    },
    Edge {
        kind: EdgeKind,
        from: GlobalNodeId,
        to: GlobalNodeId,
    },
}
Expand description

Events related to circuit construction. A handler listening to these events should be able to reconstruct complete circuit topology, including operators, nested circuits, and streams connecting them.

Variants§

§

PushRegion

Create a sub-region.

Fields

§name: Cow<'static, str>

Sub-region name.

§location: OperatorLocation

The region’s source location

§

PopRegion

Subregion complete.

§

Operator

A new regular (non-strict) operator is added to the circuit.

Fields

§node_id: GlobalNodeId

Global id of the new operator.

§name: Cow<'static, str>

Operator name.

§location: OperatorLocation

The operator’s source location

§

StrictOperatorOutput

The output half of a strict operator. A strict operator is activated twice in each clock cycle: first, its output computed based on previous inputs is read; second, a new input for the current cycle is pushed to the operator. These activations are modeled as separate circuit nodes. The StrictOperatorOutput event is emitted first, when the output node is created.

Fields

§name: Cow<'static, str>

Operator name.

§location: OperatorLocation

The operator’s source location

§

StrictOperatorInput

The input half of a strict operator is added to the circuit. This event is triggered when the circuit builder connects an input stream to the strict operator. The output node already exists at this point.

Fields

§node_id: GlobalNodeId

Node id of the input half.

§output_node_id: NodeId

Node id of the associated output node, that already exists in the circuit.

§

Subcircuit

A new nested circuit is added to the circuit.

Fields

§node_id: GlobalNodeId

Global id of the nested circuit.

§iterative: bool

true is the subcircuit has its own clock and can iterate multiple times for each parent clock tick.

§

SubcircuitComplete

Nested circuit has been fully populated.

Fields

§node_id: GlobalNodeId

Global id of the nested circuit.

§

Edge

A new edge between nodes connected as producer and consumer to the same stream. Producer and consumer nodes can be located in different subcircuits.

Fields

§from: GlobalNodeId

Global id of the producer operator that writes to the stream.

§to: GlobalNodeId

Global id of an operator or subcircuit that reads values from the stream.

Implementations§

Source§

impl CircuitEvent

Source

pub fn push_region_static( name: &'static str, location: OperatorLocation, ) -> Self

Create a CircuitEvent::PushRegion event instance.

Source

pub fn push_region(name: &str, location: OperatorLocation) -> Self

Create a CircuitEvent::PushRegion event instance.

Source

pub fn pop_region() -> Self

Create a CircuitEvent::PopRegion event.

Source

pub fn operator( node_id: GlobalNodeId, name: Cow<'static, str>, location: OperatorLocation, ) -> Self

Create a CircuitEvent::Operator event instance.

Source

pub fn strict_operator_output( node_id: GlobalNodeId, name: Cow<'static, str>, location: OperatorLocation, ) -> Self

Create a CircuitEvent::StrictOperatorOutput event instance.

Source

pub fn strict_operator_input( node_id: GlobalNodeId, output_node_id: NodeId, ) -> Self

Create a CircuitEvent::StrictOperatorInput event instance.

Source

pub fn subcircuit(node_id: GlobalNodeId, iterative: bool) -> Self

Create a CircuitEvent::Subcircuit event instance.

Source

pub fn subcircuit_complete(node_id: GlobalNodeId) -> Self

Create a CircuitEvent::SubcircuitComplete event instance.

Source

pub fn stream( from: GlobalNodeId, to: GlobalNodeId, ownership_preference: OwnershipPreference, ) -> Self

Create a CircuitEvent::Edge event instance.

Source

pub fn dependency(from: GlobalNodeId, to: GlobalNodeId) -> Self

Create a CircuitEvent::Edge event instance.

Source

pub fn is_strict_input_event(&self) -> bool

Source

pub fn is_strict_output_event(&self) -> bool

Source

pub fn is_operator_event(&self) -> bool

true if self is a CircuitEvent::Operator

Source

pub fn is_subcircuit_event(&self) -> bool

true if self is a CircuitEvent::Subcircuit

Source

pub fn is_iterative_subcircuit_event(&self) -> bool

true if self is a CircuitEvent::Subcircuit and self.iterative is true.

Source

pub fn is_edge_event(&self) -> bool

true if self is a CircuitEvent::Edge

Source

pub fn is_node_event(&self) -> bool

Source

pub fn is_new_node_event(&self) -> bool

Source

pub fn node_id(&self) -> Option<&GlobalNodeId>

If self is one of the node creation events, returns self.node_id.

Source

pub fn node_name(&self) -> Option<&Cow<'static, str>>

If self is a CircuitEvent::Operator or CircuitEvent::StrictOperatorOutput, returns self.name.

Source

pub fn location(&self) -> OperatorLocation

Source

pub fn output_node_id(&self) -> Option<NodeId>

If self is a CircuitEvent::StrictOperatorInput, returns self.output_node_id.

Source

pub fn from(&self) -> Option<&GlobalNodeId>

If self is a CircuitEvent::Edge, returns self.from.

Source

pub fn to(&self) -> Option<&GlobalNodeId>

If self is a CircuitEvent::Edge, returns self.to.

Source

pub fn edge_kind(&self) -> Option<&EdgeKind>

If self is a CircuitEvent::Edge, returns self.kind.

Trait Implementations§

Source§

impl Clone for CircuitEvent

Source§

fn clone(&self) -> CircuitEvent

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 Debug for CircuitEvent

Source§

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

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

impl Display for CircuitEvent

Source§

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

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

impl Hash for CircuitEvent

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for CircuitEvent

Source§

fn eq(&self, other: &CircuitEvent) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for CircuitEvent

Source§

impl StructuralPartialEq for CircuitEvent

Auto Trait Implementations§

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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> AsAny for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

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> CallHasher for T
where T: Hash + ?Sized,

Source§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

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> CustomError for T
where T: Display + Debug + Send + Sync + 'static,

Source§

fn as_any(&self) -> &(dyn Any + Sync + Send + 'static)

Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + Sync + Send + 'static)

Source§

fn as_box_any(self: Box<T>) -> Box<dyn Any + Sync + Send>

Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> Data for T
where T: Clone + 'static,

Source§

impl<T> ErasedDestructor for T
where T: 'static,