Struct LogicalCashUnit

Source
#[repr(C)]
pub struct LogicalCashUnit { /* private fields */ }
Expand description

Represents a logical cash unit, and its parameters.

Implementations§

Source§

impl LogicalCashUnit

Source

pub const fn new() -> Self

Creates a new LogicalCashUnit.

Source

pub const fn cash_type(&self) -> CashType

Gets the CashType.

Defines the main type of cash used by this cash unit.

Source

pub fn set_cash_type(&mut self, cash_type: CashType)

Sets the CashType.

Source

pub fn with_cash_type(self, cash_type: CashType) -> Self

Builder function that sets the CashType.

Source

pub const fn secondary_cash_types(&self) -> &CashTypeList

Gets the secondary CashTypeList.

Defines the additional types of cash used by this cash unit.

Source

pub fn set_secondary_cash_types(&mut self, secondary_cash_types: CashTypeList)

Sets the secondary CashTypeList.

Source

pub fn with_secondary_cash_types( self, secondary_cash_types: CashTypeList, ) -> Self

Builder function that sets the secondary CashType.

Source

pub const fn number(&self) -> u32

Gets the logical number of cash unit.

Unique number of the cash unit. This number is assigned (or reassigned) on bnr_Reset() and identifies the unit along the time; therefore, it can be used to track unit changes, or uniquely reference units in method calls (DenominationItem::unit property is an example).

Source

pub fn set_number(&mut self, number: u32)

Sets the number.

Source

pub fn with_number(self, number: u32) -> Self

Builder function that sets the number.

Source

pub const fn cu_kind(&self) -> CuKind

Specifies, if cash unit can dispense, deposit cash or both.

Source

pub fn set_cu_kind(&mut self, cu_kind: CuKind)

Sets the cu_kind field, see [LCU].

Source

pub fn with_cu_kind(self, cu_kind: CuKind) -> Self

Builder function that sets the cu_kind.

Source

pub const fn cu_type(&self) -> CuType

Gets the type of cash unit.

Source

pub fn set_cu_type(&mut self, cu_type: CuType)

Sets the cu_type field, see [LCU].

Source

pub fn with_cu_type(self, cu_type: CuType) -> Self

Builder function that sets the cu_type.

Source

pub const fn unit_id(&self) -> UnitId

Gets the UnitId.

Source

pub fn set_unit_id(&mut self, unit_id: UnitId)

Sets the UnitId.

Source

pub fn with_unit_id(self, unit_id: UnitId) -> Self

Builder function that sets the UnitId.

Source

pub const fn initial_count(&self) -> u32

For customer purpose only; this value is initialized by the configure_cash_unit and update_cash_unit methods and not changed by the BNR.

Source

pub fn set_initial_count(&mut self, initial_count: u32)

Sets the initial count.

Source

pub fn with_initial_count(self, initial_count: u32) -> Self

Builder function that sets the initial count.

Source

pub const fn count(&self) -> u32

Actual count of bills in the logical cash unit.

  • Type: One Shot.
  • Max: 65535.
  • Access:
Source

pub fn set_count(&mut self, count: u32)

Sets the count.

Source

pub fn with_count(self, count: u32) -> Self

Builder function that sets the count.

Source

pub const fn status(&self) -> u32

Cash unit status. Correspond to [PhysicalCashUnit::status].

Source

pub fn set_status(&mut self, status: u32)

Sets the status.

Source

pub fn with_status(self, status: u32) -> Self

Builder function that sets the status.

Source

pub const fn extended_counters(&self) -> &ExtendedCounters

Gets the ExtendedCounters for [LCU::Deposit] and [LCU::Dispense] cash unit types.

Source

pub fn set_extended_counters(&mut self, extended_counters: ExtendedCounters)

Sets the ExtendedCounters.

Source

pub fn with_extended_counters(self, extended_counters: ExtendedCounters) -> Self

Builder function that sets the extended_counters.

Source

pub const fn physical_cu_index(&self) -> UnitId

Gets the UnitId of the [PhysicalCashUnit] backing this LogicalCashUnit.

The C library uses a pointer here, but that is wildly unsafe. Use the ID instead.

Source

pub fn set_physical_cu_index(&mut self, pcu_index: UnitId)

Sets the physical cash unit UnitId.

Source

pub fn with_physical_cash_unit(self, pcu_index: UnitId) -> Self

Builder function that sets the physical cash unit UnitId.

Source§

impl LogicalCashUnit

Source

pub const fn xfs_name() -> &'static str

Gets the XfsMember name.

Trait Implementations§

Source§

impl Clone for LogicalCashUnit

Source§

fn clone(&self) -> LogicalCashUnit

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 LogicalCashUnit

Source§

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

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

impl Default for LogicalCashUnit

Source§

fn default() -> LogicalCashUnit

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

impl Display for LogicalCashUnit

Source§

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

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

impl From<&LogicalCashUnit> for XfsMember

Source§

fn from(val: &LogicalCashUnit) -> Self

Converts to this type from the input type.
Source§

impl From<&LogicalCashUnit> for XfsStruct

Source§

fn from(val: &LogicalCashUnit) -> Self

Converts to this type from the input type.
Source§

impl From<&LogicalCashUnit> for XfsValue

Source§

fn from(val: &LogicalCashUnit) -> Self

Converts to this type from the input type.
Source§

impl From<LogicalCashUnit> for XfsMember

Source§

fn from(val: LogicalCashUnit) -> Self

Converts to this type from the input type.
Source§

impl From<LogicalCashUnit> for XfsStruct

Source§

fn from(val: LogicalCashUnit) -> Self

Converts to this type from the input type.
Source§

impl From<LogicalCashUnit> for XfsValue

Source§

fn from(val: LogicalCashUnit) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for LogicalCashUnit

Source§

fn eq(&self, other: &LogicalCashUnit) -> 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<&XfsMember> for LogicalCashUnit

Source§

type Error = Error

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

fn try_from(val: &XfsMember) -> Result<Self>

Performs the conversion.
Source§

impl TryFrom<&XfsStruct> for LogicalCashUnit

Source§

type Error = Error

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

fn try_from(val: &XfsStruct) -> Result<Self>

Performs the conversion.
Source§

impl TryFrom<&XfsValue> for LogicalCashUnit

Source§

type Error = Error

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

fn try_from(val: &XfsValue) -> Result<Self>

Performs the conversion.
Source§

impl TryFrom<XfsMember> for LogicalCashUnit

Source§

type Error = Error

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

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

Performs the conversion.
Source§

impl TryFrom<XfsStruct> for LogicalCashUnit

Source§

type Error = Error

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

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

Performs the conversion.
Source§

impl TryFrom<XfsValue> for LogicalCashUnit

Source§

type Error = Error

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

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

Performs the conversion.
Source§

impl Copy for LogicalCashUnit

Source§

impl StructuralPartialEq for LogicalCashUnit

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> 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.