Struct libftd2xx::EepromStrings
source · pub struct EepromStrings { /* private fields */ }
Expand description
EEPROM strings structure.
This structure contains the strings programmed into EEPROM that are common across all FTDI devices.
This is used by the eeprom_read
and eeprom_program
methods.
Implementations§
source§impl EepromStrings
impl EepromStrings
sourcepub fn with_strs(
manufacturer: &str,
manufacturer_id: &str,
description: &str,
serial_number: &str
) -> Result<Self, EepromStringsError>
pub fn with_strs( manufacturer: &str, manufacturer_id: &str, description: &str, serial_number: &str ) -> Result<Self, EepromStringsError>
Create a new EEPROM strings structure.
sourcepub fn with_slices(
manufacturer: &[i8],
manufacturer_id: &[i8],
description: &[i8],
serial_number: &[i8]
) -> Result<Self, EepromStringsError>
pub fn with_slices( manufacturer: &[i8], manufacturer_id: &[i8], description: &[i8], serial_number: &[i8] ) -> Result<Self, EepromStringsError>
Create a new EEPROM strings structure from raw slices.
sourcepub fn string_len(&self) -> usize
pub fn string_len(&self) -> usize
Total length of the manufacturer
, manufacturer_id
,
description
, and serial_number
strings.
Together these strings cannot exceed 96 characters.
sourcepub fn manufacturer(&self) -> String
pub fn manufacturer(&self) -> String
Manufacturer string.
sourcepub fn set_manufacturer(
&mut self,
value: String
) -> Result<(), EepromStringsError>
pub fn set_manufacturer( &mut self, value: String ) -> Result<(), EepromStringsError>
Set the manufacturer string.
§Requirements
- Less than or equal to 64 characters.
- The total length of the
manufacturer
,manufacturer_id
,description
, andserial_number
strings can not exceed 96 characters.
sourcepub fn manufacturer_id(&self) -> String
pub fn manufacturer_id(&self) -> String
Manufacturer ID string.
sourcepub fn set_manufacturer_id(
&mut self,
value: String
) -> Result<(), EepromStringsError>
pub fn set_manufacturer_id( &mut self, value: String ) -> Result<(), EepromStringsError>
Set the manufacturer ID string.
The first two characters of this string should be the same as the first two characters of the device serial number. For example, if your manufacturer ID is “FTDI” your serial number should start with “FT”.
§Requirements
- Less than or equal to 64 characters.
- The total length of the
manufacturer
,manufacturer_id
,description
, andserial_number
strings can not exceed 96 characters.
sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Description string.
sourcepub fn set_description(
&mut self,
value: String
) -> Result<(), EepromStringsError>
pub fn set_description( &mut self, value: String ) -> Result<(), EepromStringsError>
Set the description string.
§Requirements
- Less than or equal to 64 characters.
- The total length of the
manufacturer
,manufacturer_id
,description
, andserial_number
strings can not exceed 96 characters.
sourcepub fn serial_number(&self) -> String
pub fn serial_number(&self) -> String
Serial number string.
sourcepub fn set_serial_number(
&mut self,
value: String
) -> Result<(), EepromStringsError>
pub fn set_serial_number( &mut self, value: String ) -> Result<(), EepromStringsError>
Set the manufacturer ID string.
The first two characters of this string should be the same as the first two characters of the device serial number. For example, if your manufacturer ID is “FTDI” your serial number should start with “FT”.
§Requirements
- Less than or equal to 64 characters.
- The total length of the
manufacturer
,manufacturer_id
,description
, andserial_number
strings can not exceed 96 characters.
Trait Implementations§
source§impl Clone for EepromStrings
impl Clone for EepromStrings
source§fn clone(&self) -> EepromStrings
fn clone(&self) -> EepromStrings
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EepromStrings
impl Debug for EepromStrings
source§impl Default for EepromStrings
impl Default for EepromStrings
source§fn default() -> EepromStrings
fn default() -> EepromStrings
source§impl PartialEq for EepromStrings
impl PartialEq for EepromStrings
source§fn eq(&self, other: &EepromStrings) -> bool
fn eq(&self, other: &EepromStrings) -> bool
self
and other
values to be equal, and is used
by ==
.