Skip to main content

Pull

Struct Pull 

Source
pub struct Pull<N> { /* private fields */ }
Expand description

A wrapper around a Node that enables pull evaluation across all inputs.

The implementation of Node will match the inner node type N, but with a unique implementation of Node::pull_eval.

Implementations§

Source§

impl<N: Node> Pull<N>

Source

pub fn all(node: N) -> Self

Given some node, return a Pull node enabling pull evaluation across all outputs.

Source

pub fn new(node: N, conf: EvalConf) -> Self

Given some node, return a Pull node enabling pull evaluation across some subset of the outputs.

Trait Implementations§

Source§

impl<N: CaHash> CaHash for Pull<N>

Source§

fn hash(&self, hasher: &mut Hasher)

Hash self to produce a stable content address.
Source§

impl<N: Clone> Clone for Pull<N>

Source§

fn clone(&self) -> Pull<N>

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<N: Debug> Debug for Pull<N>

Source§

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

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

impl<'de, N> Deserialize<'de> for Pull<N>
where N: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<N: Node> Node for Pull<N>

Source§

fn n_inputs(&self, ctx: MetaCtx<'_>) -> usize

The number of inputs to the node. Read more
Source§

fn n_outputs(&self, ctx: MetaCtx<'_>) -> usize

The number of outputs from the node. Read more
Source§

fn branches(&self, ctx: MetaCtx<'_>) -> Vec<EvalConf>

The list of possible branches from this node. Read more
Source§

fn expr(&self, ctx: ExprCtx<'_, '_>) -> ExprResult

The expression that, given the expressions of connected inputs, produces the output(s). Read more
Source§

fn push_eval(&self, ctx: MetaCtx<'_>) -> Vec<EvalConf>

Specifies whether or not code should be generated to allow for push evaluation from instances of this node. Enabling push evaluation allows applications to call into the graph by calling the resulting generated code at runtime. Read more
Source§

fn pull_eval(&self, _ctx: MetaCtx<'_>) -> Vec<EvalConf>

Specifies whether or not code should be generated to allow for pull evaluation from instances of this node. Enabling pull evaluation allows applications to call into the graph by loading the resulting generated code at runtime. Read more
Source§

fn inlet(&self, ctx: MetaCtx<'_>) -> bool

Whether or not this node acts as an inlet for some nested graph.
Source§

fn outlet(&self, ctx: MetaCtx<'_>) -> bool

Whether or not this node acts as an outlet for some nested graph.
Source§

fn stateful(&self, ctx: MetaCtx<'_>) -> bool

Whether or not the node requires access to state. Read more
Source§

fn register(&self, ctx: RegCtx<'_, '_>)

Function for registering necessary types, functions and initialising any default values as necessary. Read more
Source§

fn required_addrs(&self) -> Vec<ContentAddr>

Returns the content addresses of external nodes this node requires. Read more
Source§

fn delay(&self, _ctx: MetaCtx<'_>) -> bool

Whether or not this node is a unit delay: its output is the value its input received on the previous evaluation. Read more
Source§

fn visit(&self, _ctx: Ctx<'_, '_>, _visitor: &mut dyn Visitor)

Traverse all nested nodes, depth-first, with the given Visitor. Read more
Source§

impl<N> Serialize for Pull<N>
where N: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<N> Freeze for Pull<N>
where N: Freeze,

§

impl<N> RefUnwindSafe for Pull<N>
where N: RefUnwindSafe,

§

impl<N> Send for Pull<N>
where N: Send,

§

impl<N> Sync for Pull<N>
where N: Sync,

§

impl<N> Unpin for Pull<N>
where N: Unpin,

§

impl<N> UnsafeUnpin for Pull<N>
where N: UnsafeUnpin,

§

impl<N> UnwindSafe for Pull<N>
where N: 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> CloneAny for T
where T: Any + Clone,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

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

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> MaybeSendSyncStatic for T
where T: 'static,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SendSyncStatic for T
where T: Send + Sync + 'static,

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

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

Source§

fn vzip(self) -> V

Source§

impl<N> WithPullEval for N
where N: Node,

Source§

fn with_pull_eval_conf(self, conf: EvalConf) -> Pull<N>

Consume self and return an equivalent node with pull evaluation enabled.

Source§

fn with_pull_eval(self) -> Pull<Self>

Consume self and return a Node that has pull evaluation enabled.
Source§

impl<N> WithPushEval for N
where N: Node,

Source§

fn with_push_eval_conf(self, conf: EvalConf) -> Push<N>

Consume self and return a Node that has push evaluation enabled.
Source§

fn with_push_eval(self) -> Push<Self>

Consume self and return a Node that has push evaluation enabled.
Source§

impl<N> WithStateType for N
where N: Node,

Source§

fn with_state_type<S>(self) -> State<N, S>
where S: NodeState,

Consume self and return a Node that has state of type state_type.