Skip to main content

DEv

Enum DEv 

Source
#[non_exhaustive]
pub enum DEv {
Show 15 variants Select, Move { keys: Vec<u64>, d: [f32; 2], total: [f32; 2], done: bool, }, Connect { from: u64, to: u64, quick: bool, }, ConnectDrag { from: u64, at: [f32; 2], over: u64, }, ConnectCancel, Waypoint { edge: u64, idx: u32, at: [f32; 2], insert: bool, done: bool, }, WaypointDelete { edge: u64, idx: u32, }, Activate(DHit), Context(DHit, [i32; 2]), Delete, Click { at: [f32; 2], }, DoubleClick { at: [f32; 2], }, ViewChanged, Toggle(u64), Resize { key: u64, rect: [f32; 4], done: bool, },
}
Expand description

what the user did (ui.diagram’s result, in order)

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Select

st.sel changed

§

Move

move nodes keys by d (world units); the d of one gesture add up to total; done = the gesture ended (released, a key nudge; Esc sends d = minus everything so far)

Fields

§keys: Vec<u64>
§d: [f32; 2]
§total: [f32; 2]
§done: bool
§

Connect

connect from -> to (port or node keys); quick = dragged out of a port with DG_SELECT

Fields

§from: u64
§to: u64
§quick: bool
§

ConnectDrag

a connection is being drawn: the pointer at at, over port / node over (0 = none)

Fields

§from: u64
§at: [f32; 2]
§over: u64
§

ConnectCancel

the connection ended without a target (released elsewhere, Esc)

§

Waypoint

waypoint idx of edge goes to at; insert = add it at idx first (the first event of a drag from a middle handle); done = released

Fields

§edge: u64
§idx: u32
§at: [f32; 2]
§insert: bool
§done: bool
§

WaypointDelete

remove waypoint idx of edge (double click on its handle, Esc after an insert)

Fields

§edge: u64
§idx: u32
§

Activate(DHit)

double click on a node / port / edge, Enter on the focused node

§

Context(DHit, [i32; 2])

right click, Shift+F10 or the menu key: at = window px (logical, for popups)

§

Delete

Del with a selection: delete st.sel

§

Click

a click on the background, or anywhere with DG_PLACE (snapped then); world units

Fields

§at: [f32; 2]
§

DoubleClick

a double click on the background with DG_SELECT (no Shift, no Ctrl): the world point of the second press, not snapped; neither a Click nor a marquee follows it

Fields

§at: [f32; 2]
§

ViewChanged

zoom or centre changed

§

Toggle(u64)

a click on the collapse button of a DN_TOGGLE node

§

Resize

the resize handle of a DN_RESIZE node was dragged: its new box x, y, w, h (world, the top left corner stays; at least 8 units); done = released (Esc: the box it had)

Fields

§key: u64
§rect: [f32; 4]
§done: bool

Trait Implementations§

Source§

impl Clone for DEv

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 DEv

Source§

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

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

impl PartialEq for DEv

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 StructuralPartialEq for DEv

Auto Trait Implementations§

§

impl Forget for DEv

§

impl Freeze for DEv

§

impl RefUnwindSafe for DEv

§

impl Send for DEv

§

impl Sync for DEv

§

impl Unpin for DEv

§

impl UnsafeUnpin for DEv

§

impl UnwindSafe for DEv

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> ErasedDestructor for T
where T: 'static,

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.