Skip to main content

CalcValue

Enum CalcValue 

Source
pub enum CalcValue {
    Visibility {
        target: ElementTarget,
    },
    Display {
        target: ElementTarget,
    },
    Id {
        target: ElementTarget,
    },
    DataAttrValue {
        attr: String,
        target: ElementTarget,
    },
    EventValue,
    WidthPx {
        target: ElementTarget,
    },
    HeightPx {
        target: ElementTarget,
    },
    PositionX {
        target: ElementTarget,
    },
    PositionY {
        target: ElementTarget,
    },
    MouseX {
        target: Option<ElementTarget>,
    },
    MouseY {
        target: Option<ElementTarget>,
    },
    Key {
        key: Key,
    },
}
Expand description

Computed value from element or event state

Represents a value that is calculated at runtime based on element properties, mouse position, or event data. These values are used in conditional logic and parameterized actions.

Variants§

§

Visibility

Get visibility state of an element

Fields

§target: ElementTarget

Target element

§

Display

Get display state of an element

Fields

§target: ElementTarget

Target element

§

Id

Get element ID of an element

Fields

§target: ElementTarget

Target element

§

DataAttrValue

Get data attribute value from an element

Fields

§attr: String

Attribute name

§target: ElementTarget

Target element

§

EventValue

Get current event value (e.g., input field value)

§

WidthPx

Get width in pixels of an element

Fields

§target: ElementTarget

Target element

§

HeightPx

Get height in pixels of an element

Fields

§target: ElementTarget

Target element

§

PositionX

Get X position of an element

Fields

§target: ElementTarget

Target element

§

PositionY

Get Y position of an element

Fields

§target: ElementTarget

Target element

§

MouseX

Get mouse X coordinate (optionally relative to element)

Fields

§target: Option<ElementTarget>

Optional target element for relative coordinates

§

MouseY

Get mouse Y coordinate (optionally relative to element)

Fields

§target: Option<ElementTarget>

Optional target element for relative coordinates

§

Key

Get keyboard key value

Fields

§key: Key

Keyboard key

Implementations§

Source§

impl CalcValue

Source

pub fn eq(self, other: impl Into<Value>) -> Condition

Creates an equality condition comparing this value to another

Source

pub fn plus(self, other: impl Into<Value>) -> Arithmetic

Adds another value to this value

Source

pub fn minus(self, other: impl Into<Value>) -> Arithmetic

Subtracts another value from this value

Source

pub fn multiply(self, other: impl Into<Value>) -> Arithmetic

Multiplies this value by another value

Source

pub fn divide(self, other: impl Into<Value>) -> Arithmetic

Divides this value by another value

Source

pub fn min(self, other: impl Into<Value>) -> Arithmetic

Returns the minimum of this value and another

Source

pub fn max(self, other: impl Into<Value>) -> Arithmetic

Returns the maximum of this value and another

Source

pub fn clamp(self, min: impl Into<Value>, max: impl Into<Value>) -> Arithmetic

Clamps this value between min and max bounds

Source

pub fn then_pass_to(self, other: impl Into<ActionType>) -> ActionType

Creates a parameterized action that passes this value to the action

Trait Implementations§

Source§

impl Arbitrary for CalcValue

Available on crate feature logic only.
Source§

fn arbitrary_with((): Self::Parameters) -> Self::Strategy

Generates an arbitrary CalcValue for property-based testing

Source§

type Parameters = ()

The type of parameters that arbitrary_with accepts for configuration of the generated Strategy. Parameters must implement Default.
Source§

type Strategy = BoxedStrategy<CalcValue>

The type of Strategy used to generate values of type Self.
Source§

fn arbitrary() -> Self::Strategy

Generates a Strategy for producing arbitrary values of type the implementing type (Self). Read more
Source§

impl Clone for CalcValue

Source§

fn clone(&self) -> CalcValue

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

Source§

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

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

impl<'de> Deserialize<'de> for CalcValue

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 Eq for CalcValue

Source§

impl From<CalcValue> for Value

Source§

fn from(value: CalcValue) -> Self

Converts a CalcValue into a Value

Source§

impl PartialEq for CalcValue

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 Serialize for CalcValue

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

impl StructuralPartialEq for CalcValue

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

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