Skip to main content

GcodeIndex

Struct GcodeIndex 

Source
pub struct GcodeIndex { /* private fields */ }
Expand description

One file’s slicer plan, by file position.

Implementations§

Source§

impl GcodeIndex

Source

pub const fn bytes(&self) -> u64

How many bytes the index was built from.

Source

pub const fn lines(&self) -> u64

How many lines the index was built from.

Source

pub const fn layer_count(&self) -> usize

How many layers the file plans.

Source

pub const fn entries(&self) -> usize

How many entries the index holds: layers, time marks, flow and fan settings, and objects.

Source

pub fn resident_bytes(&self) -> usize

How many bytes the index itself holds on the heap and inline, which is what keeping it in memory for a print costs.

Source

pub fn busiest_layer(&self) -> Option<(usize, i64)>

The most extrusion types any one layer lays material under, and the file position just past that layer’s ;LAYER_CHANGE: where the plan names the most.

Source

pub fn flow_at(&self, position: i64) -> Option<SetInFile>

The flow factor the file had set by a position, when it had set one.

Source

pub fn fan_at(&self, position: i64) -> Option<SetInFile>

The part-cooling fan speed the file had set by a position, in percent, when it had set one.

Source

pub fn plan_at(&self, position: i64) -> SlicerPlan

The slicer’s plan at one file position, with no change made through this program beside what the file set.

Source

pub fn plan_with( &self, position: i64, flow_changed: Option<f64>, fan_changed: Option<f64>, ) -> SlicerPlan

The slicer’s plan at one file position, with the flow factor and fan speed changed through this program since the file last set each, when there was such a change.

Source

pub fn risen_since(&self, earlier: i64, now: i64) -> Option<f64>

The height the parts themselves have gained between two positions, in millimetres to a tenth: each layer after the earlier one’s, up to the later one’s, that lays anything but supports adds its rise over the part’s top so far, and a layer laying supports alone adds nothing, because nothing a camera watches grows there — so a support layer slicer-interleaved between two of the part’s is not the floor the next one rises from. Nothing where a position has no layer with a height.

Source

pub fn height_and_rise_since(&self, earlier: i64, now: i64) -> Option<[f64; 2]>

The part’s own top at an earlier position and the height it gains from there to a later one, each in millimetres to a tenth, as risen_since counts the gain.

Trait Implementations§

Source§

impl Clone for GcodeIndex

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 GcodeIndex

Source§

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

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

impl PartialEq for GcodeIndex

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 GcodeIndex

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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.