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).
UpdateEntity
Patch an entity.
SetParams
Set numeric parameters through the solver.
Transform
Transform entities (move/rotate/scale/mirror).
Fields
§
policy: TransformPolicyPolicy for shapes that cannot represent the result.
Delete
Delete entities.
Reorder
Move an entity in draw order.
AddConstraint
Add a constraint.
UpdateConstraint
Update a constraint.
RemoveConstraint
Remove a constraint.
Fields
§
id: ConstraintIdConstraint.
AddLayer
Add a layer.
UpdateLayer
Update a layer.
RemoveLayer
Remove an empty layer.
MoveLayer
Move a layer in the stack.
Group
Group entities.
Ungroup
Dissolve a group (members stay).
Paste
Paste clipboard content.
Split
Split a line/arc/polyline at a point (circles need at2).
Fields
Trim
Trim the piece of an entity between cutting edges around pick.
Extend
Extend an end of a line/arc/polyline to boundaries.
SetSettings
Update document settings.
Fields
§
patch: SettingsPatchChanges.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Command
impl<'de> Deserialize<'de> for Command
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
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
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.