Skip to main content

Latch

Struct Latch 

Source
pub struct Latch {
    pub name: String,
    pub arm: Expr,
    pub fire: Expr,
    pub hold: f32,
}
Expand description

One [latch] entry, compiled (ADR-0137): a gate armed on one condition and fired by the first rising edge of another inside the arming window.

Its slot is its position in Preset::latches, and that is the only place the mapping exists: the loader resolved the author’s name onto a reserved variable slot while compiling the bindings, so nothing per-frame looks a latch up by name. The same reasoning that keeps [smoothing] off Preset as a table — a fact about the preset, resolved once, and the preset does not change while it renders.

The two expressions are compiled without any latch name in scope, so a latch cannot read a latch. That is not a restriction waiting to be lifted: it is what makes “evaluate every latch, then the params that read them” a complete order rather than one with a dependency graph inside it.

Fields§

§name: String

The author’s name for it, which its bindings reference.

§arm: Expr

While this holds (> 0.5), the latch is armed. Its fall re-arms.

§fire: Expr

The rising edge that fires an armed latch.

§hold: f32

How long the fired latch reads 1.0, in seconds. 0 is one frame.

Trait Implementations§

Source§

impl Debug for Latch

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Latch

§

impl RefUnwindSafe for Latch

§

impl Send for Latch

§

impl Sync for Latch

§

impl Unpin for Latch

§

impl UnsafeUnpin for Latch

§

impl UnwindSafe for Latch

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

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

§

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

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,