#[non_exhaustive]pub struct Barcode {
pub format: String,
pub value_format: String,
pub raw_value: String,
/* private fields */
}Expand description
Encodes the detailed information of a barcode.
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.format: StringFormat of a barcode. The supported formats are:
CODE_128: Code 128 type.CODE_39: Code 39 type.CODE_93: Code 93 type.CODABAR: Codabar type.DATA_MATRIX: 2D Data Matrix type.ITF: ITF type.EAN_13: EAN-13 type.EAN_8: EAN-8 type.QR_CODE: 2D QR code type.UPC_A: UPC-A type.UPC_E: UPC-E type.PDF417: PDF417 type.AZTEC: 2D Aztec code type.DATABAR: GS1 DataBar code type.
value_format: StringValue format describes the format of the value that a barcode encodes. The supported formats are:
CONTACT_INFO: Contact information.EMAIL: Email address.ISBN: ISBN identifier.PHONE: Phone number.PRODUCT: Product.SMS: SMS message.TEXT: Text string.URL: URL address.WIFI: Wifi information.GEO: Geo-localization.CALENDAR_EVENT: Calendar event.DRIVER_LICENSE: Driver’s license.
raw_value: StringRaw value encoded in the barcode.
For example: 'MEBKM:TITLE:Google;URL:<https://www.google.com>;;'.
Implementations§
Source§impl Barcode
impl Barcode
pub fn new() -> Self
Sourcepub fn set_format<T: Into<String>>(self, v: T) -> Self
pub fn set_format<T: Into<String>>(self, v: T) -> Self
Sets the value of format.
Sourcepub fn set_value_format<T: Into<String>>(self, v: T) -> Self
pub fn set_value_format<T: Into<String>>(self, v: T) -> Self
Sets the value of value_format.
Sourcepub fn set_raw_value<T: Into<String>>(self, v: T) -> Self
pub fn set_raw_value<T: Into<String>>(self, v: T) -> Self
Sets the value of raw_value.
Trait Implementations§
impl StructuralPartialEq for Barcode
Auto Trait Implementations§
impl Freeze for Barcode
impl RefUnwindSafe for Barcode
impl Send for Barcode
impl Sync for Barcode
impl Unpin for Barcode
impl UnwindSafe for Barcode
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