Skip to main content

Command

Enum Command 

Source
pub enum Command {
Show 20 variants CreateEntity { id: Option<EntityId>, entity: NewEntity, }, UpdateEntity { id: EntityId, patch: EntityPatch, }, SetParams { values: Vec<ParamValue>, mode: EditMode, }, Transform { ids: Vec<EntityId>, transform: Affine, policy: TransformPolicy, }, Delete { ids: Vec<EntityId>, policy: DeletePolicy, }, Reorder { id: EntityId, index: usize, }, AddConstraint { id: Option<ConstraintId>, constraint: ConstraintSpec, }, UpdateConstraint { id: ConstraintId, patch: ConstraintPatch, }, RemoveConstraint { id: ConstraintId, }, AddLayer { id: Option<LayerId>, name: String, }, UpdateLayer { id: LayerId, patch: LayerPatch, }, RemoveLayer { id: LayerId, }, MoveLayer { id: LayerId, index: usize, }, Group { id: Option<GroupId>, members: Vec<EntityId>, name: Option<String>, }, Ungroup { id: GroupId, }, Paste { clipboard: Clipboard, offset: Vector, }, Split { id: EntityId, at: Point, at2: Option<Point>, }, Trim { id: EntityId, cutters: Vec<EntityId>, pick: Point, }, Extend { id: EntityId, end: CurveEnd, boundaries: Vec<EntityId>, }, SetSettings { patch: SettingsPatch, },
}
Expand description

One command of a transaction.

Variants§

§

CreateEntity

Create an entity (with a reserved or freshly allocated ID).

Fields

§id: Option<EntityId>

Reserved ID (see Engine::reserve_ids).

§entity: NewEntity

Content.

§

UpdateEntity

Patch an entity.

Fields

§id: EntityId

Entity.

§patch: EntityPatch

Changes.

§

SetParams

Set numeric parameters through the solver.

Fields

§values: Vec<ParamValue>

Values.

§mode: EditMode

Exact (hard) or preferred.

§

Transform

Transform entities (move/rotate/scale/mirror).

Fields

§ids: Vec<EntityId>

Entities.

§transform: Affine

World transform to apply.

§policy: TransformPolicy

Policy for shapes that cannot represent the result.

§

Delete

Delete entities.

Fields

§ids: Vec<EntityId>

Entities.

§policy: DeletePolicy

Dependency policy.

§

Reorder

Move an entity in draw order.

Fields

§id: EntityId

Entity.

§index: usize

New index (0 = bottom).

§

AddConstraint

Add a constraint.

Fields

§id: Option<ConstraintId>

Reserved ID.

§constraint: ConstraintSpec

Content.

§

UpdateConstraint

Update a constraint.

Fields

§id: ConstraintId

Constraint.

§patch: ConstraintPatch

Changes.

§

RemoveConstraint

Remove a constraint.

Fields

§id: ConstraintId

Constraint.

§

AddLayer

Add a layer.

Fields

§id: Option<LayerId>

Reserved ID.

§name: String

Name.

§

UpdateLayer

Update a layer.

Fields

§id: LayerId

Layer.

§patch: LayerPatch

Changes.

§

RemoveLayer

Remove an empty layer.

Fields

§id: LayerId

Layer.

§

MoveLayer

Move a layer in the stack.

Fields

§id: LayerId

Layer.

§index: usize

New index (0 = bottom).

§

Group

Group entities.

Fields

§id: Option<GroupId>

Reserved ID.

§members: Vec<EntityId>

Members.

§name: Option<String>

Name.

§

Ungroup

Dissolve a group (members stay).

Fields

§id: GroupId

Group.

§

Paste

Paste clipboard content.

Fields

§clipboard: Clipboard

Content.

§offset: Vector

Offset.

§

Split

Split a line/arc/polyline at a point (circles need at2).

Fields

§id: EntityId

Entity.

§at: Point

Split point (world).

§at2: Option<Point>

Second point for circles.

§

Trim

Trim the piece of an entity between cutting edges around pick.

Fields

§id: EntityId

Entity.

§cutters: Vec<EntityId>

Cutting entities.

§pick: Point

Pick point (world).

§

Extend

Extend an end of a line/arc/polyline to boundaries.

Fields

§id: EntityId

Entity.

§end: CurveEnd

Which end.

§boundaries: Vec<EntityId>

Boundary entities.

§

SetSettings

Update document settings.

Fields

§patch: SettingsPatch

Changes.

Trait Implementations§

Source§

impl Clone for Command

Source§

fn clone(&self) -> Command

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: &Command) -> 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 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.