Skip to main content

Sampling

Struct Sampling 

Source
pub struct Sampling<C>(/* private fields */)
where
    C: Series;
Expand description

Dep position only: “the last value C produced, whenever that was”. Its slot in the frame is keyed on this type itself — the [carry] behind it is storage, not a cell, the same way an [Emitter] is.

Buffering’s third sibling, and the point where the other two have a window: that one is a reach the engine retains, Folding a reach the node retains, this one a single level the engine carries across every tick the series was silent.

Trait Implementations§

Source§

impl<C> Cell for Sampling<C>
where C: Series, <C as Series>::Item: Present,

Source§

const NAME: &'static str = C::NAME

Forwarded, for the same reason Buffering’s is: the graph predicates match dep names against frame cell names, and a wrapper that renamed its dep would drop out of every one of them. The carry advances in its source’s own sweep line, so the source is also the edge an observer draws.

Source§

const RETAINED: bool = true

Whether reading this in dep position reads something the engine keeps — Buffering against the [Buffer] beside the source, Sampling against the carry beside it. Everything else is this tick’s batch and nothing more: a bare cell, a Folding reach the node holds, a Gating permission. Read more
Source§

type Out<'t> = Option<<<C as Series>::Item as Present>::Val>

Source§

const REACH: Horizon = Horizon::Unit

How far back a consumer naming this in dep position reads. A bare cell is this tick’s batch and nothing more; the wrappers (Buffering, Folding) are what state anything else. This lives on Cell rather than a Dep trait because DepSet is implemented over tuples of cells, and a blanket impl<C: Cell> Dep for C would conflict with the wrapper impls.
Source§

const FOLDED: bool = false

Whether REACH is the node’s to hold — true of Folding alone. A closed gate pulls no deps, so a folded reach is the one thing gating cannot re-warm.
Source§

const CLOCK: Option<Timeframe> = None

How often this cell publishes, for a root and for a node whose kernel changes its input’s rate (rates.node.declared). None — whenever its inputs do. Some(tf) — over elements whose tf period has closed, never re-entered while one is in progress (rates.node.whole-elements). Read more
Source§

type Gates: Bit = No

Whether a consumer naming this in dep position is dominated by it — Gating alone. A type rather than a const because it is what dispatches the dark branch (Dark), and only a type can demand a Latent out of gated nodes alone.
Source§

fn opens(_: Self::Out<'_>) -> bool

Whether this dep, read here, lets its consumer advance. true for every dep but a Gating one, whose out is permission rather than data.
Source§

impl<C> Nudge for Sampling<C>
where C: Series, <C as Series>::Item: Present, <<C as Series>::Item as Present>::Val: Bump,

Source§

type Scratch = <Sampling<C> as Cell>::Out<'static>

Source§

fn stage<'t>( out: <Sampling<C> as Cell>::Out<'t>, s: &mut <Sampling<C> as Nudge>::Scratch, bump: Option<usize>, h: f64, ) -> f64

Materialize out into scratch; if bump is Some(slot), perturb that element by about h. Returns the perturbation actually applied, in the dep’s own units — see Bump.
Source§

fn view<'l>( s: &'l <Sampling<C> as Nudge>::Scratch, ) -> <Sampling<C> as Cell>::Out<'l>

View staged scratch as this cell’s out at the borrow lifetime 'l.

Auto Trait Implementations§

§

impl<C> Forget for Sampling<C>

§

impl<C> Freeze for Sampling<C>
where PhantomData<C>: Freeze,

§

impl<C> RefUnwindSafe for Sampling<C>

§

impl<C> Send for Sampling<C>
where PhantomData<C>: Send,

§

impl<C> Sync for Sampling<C>
where PhantomData<C>: Sync,

§

impl<C> Unpin for Sampling<C>
where PhantomData<C>: Unpin,

§

impl<C> UnsafeUnpin for Sampling<C>

§

impl<C> UnwindSafe for Sampling<C>

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Dark<No> for T

Source§

fn dark() -> T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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, !>

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