#[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: FeaturesSpecific 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: MediaPrint media information for this printer.
Implementations§
Source§impl<'a> Profile<'a>
impl<'a> Profile<'a>
Sourcepub const fn new(name: Cow<'a, str>, vendor: Cow<'a, str>) -> Self
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.
Sourcepub const fn with_features(self, features: Features) -> Self
pub const fn with_features(self, features: Features) -> Self
Set Self::features to features
Sourcepub fn with_code_pages(self, code_pages: Cow<'a, IntMap<Encoding>>) -> Self
pub fn with_code_pages(self, code_pages: Cow<'a, IntMap<Encoding>>) -> Self
Set Self::code_pages to code_pages
Sourcepub fn with_colors(self, colors: Cow<'a, IntMap<Color>>) -> Self
pub fn with_colors(self, colors: Cow<'a, IntMap<Color>>) -> Self
Set Self::colors to colors
Sourcepub fn with_fonts(self, fonts: Cow<'a, IntMap<FontInfo>>) -> Self
pub fn with_fonts(self, fonts: Cow<'a, IntMap<FontInfo>>) -> Self
Set Self::fonts to fonts
Sourcepub const fn with_media(self, media: Media) -> Self
pub const fn with_media(self, media: Media) -> Self
Set Self::media to media
Trait Implementations§
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> 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