Profile

Struct Profile 

Source
#[non_exhaustive]
pub struct Profile<'a> { pub name: Cow<'a, str>, pub vendor: Cow<'a, str>, pub features: Features, pub code_pages: Cow<'a, IntMap<Encoding>>, pub colors: Cow<'a, IntMap<Color>>, pub fonts: Cow<'a, IntMap<FontInfo>>, pub media: Media, }
Expand description

A profile with capability information for an ESC/POS printer.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: Cow<'a, str>

The name of this printer.

§vendor: Cow<'a, str>

The vendor or manufacturer of this printer.

§features: Features

Specific ESC/POS features supported by this printer.

§code_pages: Cow<'a, IntMap<Encoding>>

Supported code pages.

§colors: Cow<'a, IntMap<Color>>

The ink colors supported by this printer.

§fonts: Cow<'a, IntMap<FontInfo>>

Information about the character fonts supported by this printer.

§media: Media

Print media information for this printer.

Implementations§

Source§

impl<'a> Profile<'a>

Source

pub const fn new(name: Cow<'a, str>, vendor: Cow<'a, str>) -> Self

Create a new profile.

All fields other than name and vendor are set to their default values.

Source

pub const fn with_features(self, features: Features) -> Self

Set Self::features to features

Source

pub fn with_code_pages(self, code_pages: Cow<'a, IntMap<Encoding>>) -> Self

Set Self::code_pages to code_pages

Source

pub fn with_colors(self, colors: Cow<'a, IntMap<Color>>) -> Self

Set Self::colors to colors

Source

pub fn with_fonts(self, fonts: Cow<'a, IntMap<FontInfo>>) -> Self

Set Self::fonts to fonts

Source

pub const fn with_media(self, media: Media) -> Self

Set Self::media to media

Trait Implementations§

Source§

impl<'a> Debug for Profile<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Profile<'a>

§

impl<'a> RefUnwindSafe for Profile<'a>

§

impl<'a> Send for Profile<'a>

§

impl<'a> Sync for Profile<'a>

§

impl<'a> Unpin for Profile<'a>

§

impl<'a> UnwindSafe for Profile<'a>

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