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

source

pub fn with_strs( manufacturer: &str, manufacturer_id: &str, description: &str, serial_number: &str ) -> Result<Self, EepromStringsError>

Create a new EEPROM strings structure.

source

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.

source

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.

source

pub fn manufacturer(&self) -> String

Manufacturer string.

source

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, and serial_number strings can not exceed 96 characters.
source

pub fn manufacturer_id(&self) -> String

Manufacturer ID string.

source

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, and serial_number strings can not exceed 96 characters.
source

pub fn description(&self) -> String

Description string.

source

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, and serial_number strings can not exceed 96 characters.
source

pub fn serial_number(&self) -> String

Serial number string.

source

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, and serial_number strings can not exceed 96 characters.

Trait Implementations§

source§

impl Clone for EepromStrings

source§

fn clone(&self) -> EepromStrings

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for EepromStrings

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for EepromStrings

source§

fn default() -> EepromStrings

Returns the “default value” for a type. Read more
source§

impl PartialEq for EepromStrings

source§

fn eq(&self, other: &EepromStrings) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for EepromStrings

source§

impl StructuralPartialEq for EepromStrings

Auto Trait Implementations§

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.