Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 13 variants Hello { protocol_version: u32, ui_version: String, }, Seek { frame: u32, }, Play, Pause, Step { delta: i32, }, SetViewport { w: u32, h: u32, dpr: f64, }, SetMarker { name: String, time: f64, scene: Option<String>, }, SetEase { name: String, value: [f64; 4], }, SetTunable { name: String, value: f64, }, SetTransition { scene: String, seconds: f64, }, Pick { x: f64, y: f64, }, Select { node_id: Option<u32>, }, Shutdown,
}
Expand description

UI → engine.

Variants§

§

Hello

First message after connecting; answered with Ready.

Fields

§protocol_version: u32

PROTOCOL_VERSION of the UI.

§ui_version: String

Version of the editor build, for error messages.

§

Seek

Show this frame.

Fields

§frame: u32

Global frame index.

§

Play

Start playback from the current frame.

§

Pause

Stop playback.

§

Step

Move by a number of frames.

Fields

§delta: i32

Frames to move; negative goes back.

§

SetViewport

Size the preview is shown at; frames are rendered at w·dpr × h·dpr, capped at the project size.

Fields

§w: u32

Width in CSS pixels (including the editor’s zoom).

§h: u32

Height in CSS pixels (including the editor’s zoom).

§dpr: f64

Device pixel ratio.

§

SetMarker

Moves a marker (seconds from the start of its scene). With scene, creates the marker there if it does not exist yet.

Fields

§name: String

Marker name.

§time: f64

Seconds from the start of the scene.

§scene: Option<String>

Scene to create the marker in.

§

SetEase

Changes a named ease.

Fields

§name: String

Ease name.

§value: [f64; 4]

Control points [x1, y1, x2, y2].

§

SetTunable

Changes a tunable.

Fields

§name: String

Tunable name.

§value: f64

New value.

§

SetTransition

Sets how long the transition into scene lasts, in seconds.

Fields

§scene: String

Scene the transition belongs to.

§seconds: f64

Blend length. Zero removes it.

§

Pick

Hit-test at a point in frame pixels of the project size (origin top-left). Answered with Selected.

Fields

§x: f64

Horizontal position.

§y: f64

Vertical position.

§

Select

Selects a node in the inspector, or clears the selection.

Fields

§node_id: Option<u32>

Node to select; None clears.

§

Shutdown

Asks the engine to exit (native preview server).

Trait Implementations§

Source§

impl Clone for Command

Source§

fn clone(&self) -> Self

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 Command

Source§

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

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

impl<'de> Deserialize<'de> for Command

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 PartialEq for Command

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Command

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 Command

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

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.