Skip to main content

Optimize

Trait Optimize 

Source
pub trait Optimize {
    // Required method
    fn optimize(values: &[Self]) -> Vec<&Self>
       where Self: Sized;
}
Expand description

Deduplicates modal Gerber state commands.

In RS-274X several codes are modal — once set, they remain active until explicitly changed. Emitting the same SelectAperture, InterpolationMode, or QuadrantMode command twice in a row is legal but redundant. Optimize::optimize strips the duplicates, shrinking the output file.

Required Methods§

Source

fn optimize(values: &[Self]) -> Vec<&Self>
where Self: Sized,

Returns a filtered slice that omits consecutive repeated modal commands.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Optimize for Command

Source§

fn optimize(values: &[Self]) -> Vec<&Self>

Implementors§