Skip to main content

StepValue

Trait StepValue 

Source
pub trait StepValue:
    Clone
    + PartialEq
    + Sized {
    // Required methods
    fn to_json(&self) -> Json;
    fn from_json(v: &Json) -> Option<Self>;
}
Expand description

A tool’s value in a step’s arguments and result.

Required Methods§

Source

fn to_json(&self) -> Json

The value as JSON.

Source

fn from_json(v: &Json) -> Option<Self>

The value read back from JSON (a redirect, a run-hook’s result); None when it is not one.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl StepValue for Vec<[f32; 2]>

Curve points, [[x, y], ...].

Source§

fn to_json(&self) -> Json

Source§

fn from_json(v: &Json) -> Option<Self>

Implementors§

Source§

impl StepValue for Drag

{"at": <0..1> | null, "delta": <widths>}.

Source§

impl StepValue for View

A view, {"zoom": "fit" | <physical pixels per image pixel>, "center": [x, y]}.

Source§

impl StepValue for WheelValue

{"hue": <degrees>, "chroma": <0..1>, "luminance": <value>}.