EventCode

Enum EventCode 

Source
#[repr(u16)]
pub enum EventCode {
Show 29 variants PowerUp = 0, PowerUpAcceptor = 1, PowerUpStacker = 2, Inhibit = 256, ProgramSignature = 258, Rejected = 260, Collected = 264, Clear = 512, OperationError = 513, Failure = 514, NoteStay = 769, PowerUpAcceptorAccepting = 4_113, PowerUpStackerAccepting = 4_114, Idle = 4_353, Escrow = 4_354, VendValid = 4_355, AcceptorRejected = 4_356, Returned = 4_357, AcceptorCollected = 4_360, Insert = 4_362, ConditionalVend = 4_363, Pause = 4_364, Resume = 4_365, AcceptorClear = 4_608, AcceptorOperationError = 4_609, AcceptorFailure = 4_610, AcceptorNoteStay = 4_865, FunctionAbeyance = 4_866, Reserved = 65_535,
}
Expand description

Represents code variants for specific request messages.

Variants§

§

PowerUp = 0

Normal Power Up status.

§

PowerUpAcceptor = 1

Detected a returnable note on Power Up.

§

PowerUpStacker = 2

Detected a non-returnable note on Power Up.

§

Inhibit = 256

Device is disabled.

§

ProgramSignature = 258

Notified hash value of the device firmware.

§

Rejected = 260

Note removed from transport path during Power Up.

§

Collected = 264

Note collection completed successfully.

§

Clear = 512

Resolved controversial error.

§

OperationError = 513

Unable to operate.

§

Failure = 514

Fatal error occurred.

§

NoteStay = 769

Returned note remains in Insertion Slot for a certain time.

§

PowerUpAcceptorAccepting = 4_113

Returned note left in device at Power Down is returnable at Power Up.

§

PowerUpStackerAccepting = 4_114

Returned note left in device at Power Down is non-returnable at Power Up.

§

Idle = 4_353

Device in stand-by.

§

Escrow = 4_354

An inserted note passed validation.

§

VendValid = 4_355

Stacking note is allowed.

§

AcceptorRejected = 4_356

Returning note is completed before Escrow Status is notified.

§

Returned = 4_357

Returning note is completed after Escrow Status is notified.

§

AcceptorCollected = 4_360

Stacking a note completed.

§

Insert = 4_362

Note is inserted.

§

ConditionalVend = 4_363

Conditional stacking is processed.

§

Pause = 4_364

Device has stopped.

§

Resume = 4_365

Device resumes and is operational.

§

AcceptorClear = 4_608

Device resolved controversial error.

§

AcceptorOperationError = 4_609

Unable to operate.

§

AcceptorFailure = 4_610

Fatal error occurred.

§

AcceptorNoteStay = 4_865

Returned note remains in Insertion Slot for a certain time.

§

FunctionAbeyance = 4_866

Enabled functions cannot operate.

§

Reserved = 65_535

Reserved request.

Implementations§

Source§

impl EventCode

Source

pub const fn new() -> Self

Creates a new [].

Source

pub const fn from_u16(val: u16) -> Self

Infallible conversion from a u16 into a EventCode.

Source

pub const fn to_bytes(&self) -> [u8; 2]

Converts the EventCode into a byte array.

Source

pub const fn len() -> usize

Gets the length of the EventCode.

Source

pub const fn func_id(&self) -> FuncId

Extracts the FuncId from the EventCode.

Source

pub const fn is_empty(&self) -> bool

Gets whether the EventCode contains a reserved variant.

Source

pub const fn is_valid(&self) -> bool

Gets whether the EventCode is a valid variant.

Trait Implementations§

Source§

impl Clone for EventCode

Source§

fn clone(&self) -> EventCode

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EventCode

Source§

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

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

impl Default for EventCode

Source§

fn default() -> Self

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

impl Display for EventCode

Source§

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

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

impl From<&EventCode> for &'static str

Source§

fn from(val: &EventCode) -> Self

Converts to this type from the input type.
Source§

impl From<&EventCode> for u16

Source§

fn from(val: &EventCode) -> Self

Converts to this type from the input type.
Source§

impl From<EventCode> for &'static str

Source§

fn from(val: EventCode) -> Self

Converts to this type from the input type.
Source§

impl From<EventCode> for u16

Source§

fn from(val: EventCode) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for EventCode

Source§

fn eq(&self, other: &EventCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TryFrom<&[u8]> for EventCode

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(val: &[u8]) -> Result<Self>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<&[u8; N]> for EventCode

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(val: &[u8; N]) -> Result<Self>

Performs the conversion.
Source§

impl<const N: usize> TryFrom<[u8; N]> for EventCode

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(val: [u8; N]) -> Result<Self>

Performs the conversion.
Source§

impl TryFrom<u16> for EventCode

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(val: u16) -> Result<Self>

Performs the conversion.
Source§

impl Copy for EventCode

Source§

impl Eq for EventCode

Source§

impl StructuralPartialEq for EventCode

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> 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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.