Skip to main content

SpoolRefusalCause

Enum SpoolRefusalCause 

Source
pub enum SpoolRefusalCause {
    UnknownSpool {
        spool_id: SpoolId,
    },
    RetiredSpool {
        spool_id: SpoolId,
    },
    NothingToConfirm {
        tool: i64,
    },
    InvalidAdjustmentFigure {
        field: SpoolField,
        value: f64,
    },
    TareRequired {
        spool_id: SpoolId,
    },
    DensityRequired {
        material: String,
        spool_id: Option<SpoolId>,
    },
    MissingField {
        field: SpoolField,
    },
    ConflictingFields {
        fields: Vec<SpoolField>,
    },
    UnknownTool {
        tool: i64,
    },
    NotLoaded {
        spool_id: SpoolId,
    },
    LedgerRefused,
}
Expand description

Why the spool ledger refused a command, each cause carrying what a client needs to choose the next valid request.

Variants§

§

UnknownSpool

No spool was ever registered under this identifier.

Fields

§spool_id: SpoolId

The identifier the command named.

§

RetiredSpool

The spool is retired, and takes no further command.

Fields

§spool_id: SpoolId

The retired spool.

§

NothingToConfirm

The spool named is already on the tool, and nothing is pending there or marked on it for a load to confirm.

Fields

§tool: i64

The tool the spool is already on.

§

InvalidAdjustmentFigure

A figure the command gave is not one the field can hold: not a number, or out of the field’s range.

Fields

§field: SpoolField

The field the figure was given for.

§value: f64

The figure given; always a number, because a figure JSON cannot carry is refused as it would be written rather than written as null.

§

TareRequired

A scale reading was given for a spool with no tare, so it cannot be turned into a figure.

Fields

§spool_id: SpoolId

The spool with no tare.

§

DensityRequired

The material has no known density, so the command needs one.

Fields

§material: String

The material, as given and trimmed.

§spool_id: Option<SpoolId>

The spool, when the command was about one that exists; absent for a registration.

§

MissingField

A field the command needs was empty or absent.

Fields

§field: SpoolField

The field; for a correction naming neither figure, remaining_g, which gross_g may stand in for.

§

ConflictingFields

The command gave fields only one of which it may carry.

Fields

§fields: Vec<SpoolField>

Every field given that conflicts, in the command’s own order.

§

UnknownTool

The command named a tool the printer cannot have.

Fields

§tool: i64

The tool named.

§

NotLoaded

The spool is loaded on no tool, so there is nothing to unload.

Fields

§spool_id: SpoolId

The spool.

§

LedgerRefused

The ledger refused the write the command made, because the spools changed under it; reading them again shows how.

Trait Implementations§

Source§

impl Clone for SpoolRefusalCause

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 SpoolRefusalCause

Source§

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

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

impl<'de> Deserialize<'de> for SpoolRefusalCause

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 SpoolRefusalCause

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 SpoolRefusalCause

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 SpoolRefusalCause

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.