Struct escpos_rs::PrinterProfile
source · [−]pub struct PrinterProfile { /* private fields */ }Expand description
Details required to connect and print
In order to use the full functionality of the library, some information should be provided regarding the printer. The bare minimum information needed is the product id and the vendor id.
Implementations
sourceimpl PrinterProfile
impl PrinterProfile
sourcepub fn new(
vendor_id: u16,
product_id: u16,
columns_per_font: HashMap<Font, u8>,
width: u16,
endpoint: Option<u8>,
timeout: Duration
) -> PrinterProfile
pub fn new(
vendor_id: u16,
product_id: u16,
columns_per_font: HashMap<Font, u8>,
width: u16,
endpoint: Option<u8>,
timeout: Duration
) -> PrinterProfile
Create custom printing details
Not recommended to use, as it contains a lot of arguments. See the builder function instead.
sourcepub fn builder(vendor_id: u16, product_id: u16) -> PrinterProfileBuilder
pub fn builder(vendor_id: u16, product_id: u16) -> PrinterProfileBuilder
Creates a PrinterProfileBuilder
Equivalent to a call to PrinterProfileBuilder’s new function.
// Creates a minimum data structure to connect to a printer
let printer_profile = PrinterProfile::builder(0x0001, 0x0001).build();Trait Implementations
sourceimpl Clone for PrinterProfile
impl Clone for PrinterProfile
sourcefn clone(&self) -> PrinterProfile
fn clone(&self) -> PrinterProfile
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl RefUnwindSafe for PrinterProfile
impl Send for PrinterProfile
impl Sync for PrinterProfile
impl Unpin for PrinterProfile
impl UnwindSafe for PrinterProfile
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more