Skip to main content

Strategy

Enum Strategy 

Source
#[non_exhaustive]
pub enum Strategy {
Show 42 variants Face(FaceParams), Pocket2D(Pocket2dParams), Contour2D(Contour2dParams), Adaptive2D(Adaptive2dParams), Slot(SlotParams), Trace(TraceParams), Chamfer2D(Chamfer2dParams), Engrave(EngraveParams), Bore(BoreParams), Circular(CircularParams), ThreadMill(ThreadMillParams), Drill(DrillParams), Adaptive3D(Adaptive3dParams), Pocket3D(Pocket3dParams), Parallel(ParallelParams), Contour3D(Contour3dParams), Scallop(ScallopParams), Pencil(PencilParams), SteepShallow(SteepShallowParams), Radial(RadialParams), Spiral(SpiralParams), MorphedSpiral(MorphedSpiralParams), Horizontal(HorizontalParams), Ramp(RampFinishParams), Project(ProjectParams), Flow(FlowParams), Morph(MorphParams), RestFinish(RestFinishParams), ProbeWcs(ProbeWcsParams), ProbeGeometry(ProbeGeometryParams), Pattern(PatternParams), ManualNc(ManualNcParams), Swarf(SwarfParams), MultiAxisContour(MultiAxisContourParams), RotaryWrap(RotaryWrapParams), RotaryFinish(RotaryFinishParams), MultiAxisFinish(MultiAxisFinishParams), TurnFace(TurnFaceParams), TurnProfile(TurnProfileParams), TurnGroove(TurnGrooveParams), TurnThread(TurnThreadParams), TurnPartOff(TurnPartOffParams),
}
Expand description

The strategy and its parameters. Variants beyond the 3D-finishing core start with the parameters a first implementation needs; lanes extend them.

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.
§

Face(FaceParams)

§

Pocket2D(Pocket2dParams)

§

Contour2D(Contour2dParams)

§

Adaptive2D(Adaptive2dParams)

§

Slot(SlotParams)

§

Trace(TraceParams)

§

Chamfer2D(Chamfer2dParams)

§

Engrave(EngraveParams)

§

Bore(BoreParams)

§

Circular(CircularParams)

§

ThreadMill(ThreadMillParams)

§

Drill(DrillParams)

§

Adaptive3D(Adaptive3dParams)

§

Pocket3D(Pocket3dParams)

§

Parallel(ParallelParams)

§

Contour3D(Contour3dParams)

§

Scallop(ScallopParams)

§

Pencil(PencilParams)

§

SteepShallow(SteepShallowParams)

§

Radial(RadialParams)

§

Spiral(SpiralParams)

§

MorphedSpiral(MorphedSpiralParams)

§

Horizontal(HorizontalParams)

§

Ramp(RampFinishParams)

§

Project(ProjectParams)

§

Flow(FlowParams)

§

Morph(MorphParams)

§

RestFinish(RestFinishParams)

§

ProbeWcs(ProbeWcsParams)

Probing a work offset (lane C14).

§

ProbeGeometry(ProbeGeometryParams)

Probing geometry for inspection (lane C14).

§

Pattern(PatternParams)

Pattern of other enabled operations: linear, circular, mirror or WCS offsets (lane C15).

§

ManualNc(ManualNcParams)

A manual NC entry: stop, dwell, comment, pass-through text or tool change (lane C15).

§

Swarf(SwarfParams)

§

MultiAxisContour(MultiAxisContourParams)

§

RotaryWrap(RotaryWrapParams)

§

RotaryFinish(RotaryFinishParams)

Rotary finishing: the tool axis radial to a 4th axis, line or spiral passes (lane C10).

§

MultiAxisFinish(MultiAxisFinishParams)

Multi-axis finishing over an inner 3-axis finishing operation (lane C10b).

§

TurnFace(TurnFaceParams)

§

TurnProfile(TurnProfileParams)

§

TurnGroove(TurnGrooveParams)

§

TurnThread(TurnThreadParams)

§

TurnPartOff(TurnPartOffParams)

Implementations§

Source§

impl Strategy

Source

pub const KINDS: &'static [&'static str]

Every strategy’s kind name (the serde tag), in declaration order. The contract the application lists strategies from; kind_name reads it.

Source

pub fn kind_index(&self) -> usize

Position of this variant in Strategy::KINDS.

Source

pub fn kind_name(&self) -> &'static str

Stable lowercase name of the strategy (the serde tag).

Source

pub fn enum_choices(kind: &str) -> &'static [EnumChoice]

Enum-valued fields of the strategy kind kind: the dotted JSON path of every string-tagged field and the names it may take. Variant-dependent payload fields are listed too where a nested tag selects them.

Source

pub fn default_of(kind: &str) -> Option<Strategy>

The default parameters of the strategy named kind, or None for an unknown name. The returned value may still fail validate where a strategy needs user input (morph curves, a reference tool).

Source

pub fn is_targetless(&self) -> bool

Strategies that machine nothing themselves and need no target body: patterns of other operations and manual NC entries.

Source

pub fn is_turning(&self) -> bool

Source

pub fn validate(&self) -> Result<(), String>

Trait Implementations§

Source§

impl Clone for Strategy

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 Strategy

Source§

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

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

impl Default for Strategy

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Strategy

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 Strategy

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 Strategy

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 Strategy

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.