Skip to main content

Cell

Trait Cell 

Source
pub trait Cell {
    type Out<'t>: Copy;
    type Gates: Bit = No;

    const NAME: &'static str = _;
    const REACH: Horizon = Horizon::Unit;
    const FOLDED: bool = false;
    const RETAINED: bool = false;
    const CLOCK: Option<Timeframe> = None;

    // Provided method
    fn opens(_: Self::Out<'_>) -> bool { ... }
}
Expand description

A value slot in the frame. Out<'t>: Copy — references are Copy, so a batch out enters the frame as &'t [T] and heavy root/node state is lent as &'t State.

Provided Associated Constants§

Source

const NAME: &'static str = _

What this cell is called wherever a human reads the graph — cards, edges, step_until. Defaults to the Rust path, which is right for a type whose identity is its name. A cell carrying parameters overrides it through Tag, because type_name renders those the compiler’s way and the rest of the graph spells the same cells its own.

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 RETAINED: bool = false

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.

This is what says whether a tick may be withheld from a consumer. A retained dep is there again next tick, so skipping one costs nothing; a pass-through dep skipped is a batch nobody ever sees again. Hence Emitter::opens: the engine enforces a declared rate only where it holds every input the node would have read.

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

A rate-preserving kernel’s rate is its leading dep’s and a Closes’s is its PERIOD, so those never declare one — Kernel::RATE says which, and graph! derives every node’s effective clock from it.

Who enforces the declaration follows RETAINED: see Emitter::opens.

Required Associated Types§

Source

type Out<'t>: Copy

Provided Associated Types§

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.

Provided Methods§

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Cell for Book

Option<&Book> is Latent, so the book can be gated — and a closed gate returns None without pulling deps, so no checkpoint and no frame is even read.

Source§

type Out<'t> = Option<&'t Book>

Source§

impl Cell for BookAnchors

Source§

type Out<'t> = Option<&'t BookShape>

Source§

impl Cell for BookDeltas

Source§

type Out<'t> = &'t [BookDelta]

Source§

impl Cell for McRoot

Source§

const NAME: &'static str = "MarketCap"

Source§

type Out<'t> = &'t [Mc]

Source§

impl Cell for OiRoot

Source§

type Out<'t> = &'t [Oi]

Source§

impl Cell for Trades

Source§

type Out<'t> = TradeCols<'t>

Source§

impl<B> Cell for RsiDelta<B>
where B: Series<Item = Bar>,

Source§

const NAME: &'static str

Source§

type Out<'t> = &'t [Reading]

Source§

impl<C, R> Cell for Buffering<C, R>
where C: Series, R: Reach, <C as Series>::Batch: Batch<<C as Series>::Item>,

Source§

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

Source§

const REACH: Horizon = R::HORIZON

Source§

const RETAINED: bool = true

Source§

type Out<'t> = <<C as Series>::Batch as Batch<<C as Series>::Item>>::View<'t>

Source§

impl<C, R> Cell for Folding<C, R>
where C: Cell, R: Reach,

Source§

const FOLDED: bool = true

Source§

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

Source§

const REACH: Horizon = R::HORIZON

Source§

type Out<'t> = <C as Cell>::Out<'t>

Source§

impl<C> Cell for Gating<C>
where C: Gate,

Source§

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

Source§

type Gates = Yes

Source§

type Out<'t> = bool

Source§

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

Source§

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

Source§

const RETAINED: bool = true

Source§

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

Source§

impl<N> Cell for Armed<N>
where N: Episodic, <N as Cell>::Out<'t>: for<'t> Episode,

Source§

const NAME: &'static str

Source§

type Out<'t> = bool

Source§

impl<U, D> Cell for Rsi<U, D>
where U: Series<Item = Reading> + Nudge, D: Series<Item = Reading> + Nudge,

Source§

const NAME: &'static str

Source§

type Out<'t> = &'t [Reading]

Source§

impl<X, L, const K: usize> Cell for EmaWindow<X, L, K>
where X: Series<Item = Reading> + Nudge, L: Length,

Source§

const NAME: &'static str

Source§

type Out<'t> = &'t [Reading]

Source§

impl<X, L, const K: usize> Cell for WilderWindow<X, L, K>
where X: Series<Item = Reading> + Nudge, L: Length,

Source§

const NAME: &'static str

Source§

type Out<'t> = &'t [Reading]

Source§

impl<X, L> Cell for Ema<X, L>
where X: Series<Item = Reading> + Nudge, L: Length,

Source§

const NAME: &'static str

Source§

type Out<'t> = &'t [Reading]

Source§

impl<X, L> Cell for Wilder<X, L>
where X: Series<Item = Reading> + Nudge, L: Length,

Source§

const NAME: &'static str

Source§

type Out<'t> = &'t [Reading]

Source§

impl<X, S, const N: usize> Cell for Zipf<X, S, N>
where X: Series<Item = Reading> + Nudge, S: ZipfSpec,

Source§

const NAME: &'static str

Source§

type Out<'t> = &'t [Reading]

Source§

impl<X> Cell for Gains<X>
where X: Series<Item = Reading> + Nudge,

Source§

const NAME: &'static str

Source§

type Out<'t> = &'t [Reading]

Source§

impl<X> Cell for Losses<X>
where X: Series<Item = Reading> + Nudge,

Source§

const NAME: &'static str

Source§

type Out<'t> = &'t [Reading]

Source§

impl<const TF: Timeframe> Cell for Bars<TF>

Source§

const NAME: &'static str

Source§

type Out<'t> = &'t [Bar]

Source§

impl<const TF: Timeframe> Cell for Ohlcs<TF>

Source§

const NAME: &'static str

Source§

type Out<'t> = &'t [Ohlc]

Source§

impl<const TF: Timeframe> Cell for Volumes<TF>

Source§

const NAME: &'static str

Source§

type Out<'t> = &'t [Volume]