pub struct Table { /* private fields */ }Expand description
an encoding table, used to encode barcodes.
Implementations§
Source§impl Table
impl Table
Sourcepub const fn new_from(entries: [TableEntry; 107]) -> Self
pub const fn new_from(entries: [TableEntry; 107]) -> Self
in case you want to make your own (probably incompatible) table
Use the Self::modify function to change values in the current table,
like changing what latin character matches a value
Sourcepub fn modify(&self, f: impl FnMut(&mut TableEntry)) -> Self
pub fn modify(&self, f: impl FnMut(&mut TableEntry)) -> Self
Modify a table, allowing you to set custom values for all fields of a table entry.
(tip: just make a new table entry and assign it to the parameter)
Sourcepub fn entry_in_set(
&self,
value: impl Into<BarcodeValue>,
set: BarcodeType,
) -> Option<&TableEntry>
pub fn entry_in_set( &self, value: impl Into<BarcodeValue>, set: BarcodeType, ) -> Option<&TableEntry>
given a requested value and a specific code set, find the value in the table.
It’ll return None if the value does not exist in the table, for example when you want to use a lower case character but are in Code A.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnsafeUnpin for Table
impl UnwindSafe for Table
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more