Skip to main content

RejectionReason

Enum RejectionReason 

Source
pub enum RejectionReason {
    OutOfBounds {
        adjustable: Adjustable,
        allowed: Range,
        requested: f64,
    },
    ActorMayNotRequest {
        action: ActionKind,
        actor_class: ActorClass,
    },
    NoActivePrint,
    InvalidFromState {
        state: PrinterState,
    },
    MinIntervalNotElapsed {
        interval_s: i64,
        since_last_s: i64,
    },
    UnsupportedAdjustable {
        adjustable: Adjustable,
    },
    InsufficientFilament {
        buffer_g: f64,
        remaining_g: f64,
        required_g: f64,
        spool_id: SpoolId,
        spool_name: String,
        tool: i64,
        unverified: Option<UnverifiedReason>,
    },
    UnverifiedSpool {
        reason: UnverifiedReason,
        spool_id: SpoolId,
        spool_name: String,
        tool: i64,
    },
    AnalysisUnavailable {
        file_name: String,
        waited_s: i64,
    },
    SpoolRefused {
        detail: String,
    },
}
Expand description

Why a request was refused.

Each rejection is a distinct variant, so a consumer distinguishes them by matching rather than by reading a message.

Variants§

§

OutOfBounds

The value asked for is outside the range allowed for that adjustable.

Fields

§adjustable: Adjustable

The adjustable that was asked for.

§allowed: Range

The range that was allowed.

§requested: f64

The value that was asked for.

§

ActorMayNotRequest

This actor class may not request this action at all.

Fields

§action: ActionKind

The action they asked for.

§actor_class: ActorClass

The class of the actor that asked.

§

NoActivePrint

There is no active print to act on.

§

InvalidFromState

The printer is not in a state this action is valid from.

Fields

§state: PrinterState

The state the printer is in.

§

MinIntervalNotElapsed

The agent’s minimum interval has not elapsed.

Fields

§interval_s: i64

The minimum interval, in whole seconds.

§since_last_s: i64

How long it has been since the last agent action, in whole seconds.

§

UnsupportedAdjustable

The adjustable is not one this printer has.

Fields

§adjustable: Adjustable

The adjustable this printer cannot express.

§

InsufficientFilament

A start was refused because the spool on one tool holds less than the print needs and its buffer.

Fields

§buffer_g: f64

The margin asked for beyond that, in grams.

§remaining_g: f64

What the spool holds, in grams.

§required_g: f64

What the print needs from it, in grams.

§spool_id: SpoolId

The spool loaded on it.

§spool_name: String

That spool’s name.

§tool: i64

The tool whose spool is short.

§unverified: Option<UnverifiedReason>

The spool’s oldest mark, when the short spool is also unverified.

§

UnverifiedSpool

A start was refused because the spool on one tool is unverified.

Fields

§reason: UnverifiedReason

The spool’s oldest mark.

§spool_id: SpoolId

The spool loaded on it.

§spool_name: String

That spool’s name.

§tool: i64

The tool whose spool is unverified.

§

AnalysisUnavailable

A start was refused because OctoPrint’s analysis of the file had not appeared when the start’s wait for it elapsed.

Fields

§file_name: String

The file that has no analysis.

§waited_s: i64

How long the start waited for one, in whole seconds.

§

SpoolRefused

A spool command could not be carried out.

Fields

§detail: String

Why, in a sentence naming what to do instead.

Trait Implementations§

Source§

impl Clone for RejectionReason

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 RejectionReason

Source§

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

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

impl<'de> Deserialize<'de> for RejectionReason

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 RejectionReason

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 RejectionReason

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 RejectionReason

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.