Skip to main content

Product

Struct Product 

Source
pub struct Product<'a> {
Show 18 fields pub vendor_name: &'a str, pub vendor_id: VendorId, pub product_name: &'a str, pub product_id: u16, pub hardware_version: u16, pub hardware_version_string: &'a str, pub software_version: u32, pub software_version_string: &'a str, pub unique_id: &'a str, pub capability_minima: CapabilityMinima, pub max_paths_per_invoke: u16, pub manufacturing_date: Option<&'a str>, pub part_number: Option<&'a str>, pub product_url: Option<&'a str>, pub product_label: Option<&'a str>, pub serial_number: Option<&'a str>, pub appearance: Option<ProductAppearance>, pub configuration_version: u32,
}
Expand description

The F-quality attributes — everything a product knows about itself at build time.

A const record in flash. Every field the specification marks optional is an Option, and None means the attribute is not served, which is exactly what an absent optional attribute must look like: UNSUPPORTED_ATTRIBUTE, and absent from AttributeList.

Fields§

§vendor_name: &'a str

VendorName (§11.1.5.2).

§vendor_id: VendorId

VendorID (§11.1.5.3).

§product_name: &'a str

ProductName (§11.1.5.4).

§product_id: u16

ProductID (§11.1.5.5).

§hardware_version: u16

HardwareVersion (§11.1.5.8).

§hardware_version_string: &'a str

HardwareVersionString (§11.1.5.9), 1 to 64 characters.

§software_version: u32

SoftwareVersion (§11.1.5.10).

§software_version_string: &'a str

SoftwareVersionString (§11.1.5.11), 1 to 64 characters.

§unique_id: &'a str

UniqueID (§11.1.5.19) — mandatory from revision 4. “It SHALL NOT be identical to the SerialNumber attribute” and “SHALL NOT be printed on the product”.

§capability_minima: CapabilityMinima

CapabilityMinima (§11.1.5.20).

§max_paths_per_invoke: u16

MaxPathsPerInvoke (§11.1.5.23), min 1.

§manufacturing_date: Option<&'a str>

ManufacturingDate (§11.1.5.12) — YYYYMMDD plus up to 8 vendor-defined characters.

§part_number: Option<&'a str>

PartNumber (§11.1.5.13).

§product_url: Option<&'a str>

ProductURL (§11.1.5.14) — “SHALL use the https scheme”.

§product_label: Option<&'a str>

ProductLabel (§11.1.5.15).

§serial_number: Option<&'a str>

SerialNumber (§11.1.5.16).

§appearance: Option<ProductAppearance>

ProductAppearance (§11.1.5.21).

§configuration_version: u32

ConfigurationVersion (§11.1.5.24), min 1 — revision 6. N, but it changes only with the node’s configuration, so it is given rather than written.

Implementations§

Source§

impl<'a> Product<'a>

Source

pub const fn new( vendor_name: &'a str, vendor_id: VendorId, product_name: &'a str, product_id: u16, unique_id: &'a str, ) -> Self

A product with only the mandatory fixed attributes.

Source

pub const fn with_hardware(self, version: u16, string: &'a str) -> Self

The same product with hardware version information.

Source

pub const fn with_software(self, version: u32, string: &'a str) -> Self

The same product with software version information.

Source

pub const fn with_serial_number(self, serial_number: &'a str) -> Self

The same product with a serial number.

Source

pub const fn with_capability_minima(self, minima: CapabilityMinima) -> Self

The same product with CapabilityMinima.

Source

pub const fn with_max_paths_per_invoke(self, max: u16) -> Self

The same product with a MaxPathsPerInvoke.

Trait Implementations§

Source§

impl<'a> Clone for Product<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for Product<'a>

Source§

impl<'a> Debug for Product<'a>

Source§

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

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

impl<'a> Eq for Product<'a>

Source§

impl<'a> PartialEq for Product<'a>

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl<'a> StructuralPartialEq for Product<'a>

Auto Trait Implementations§

§

impl<'a> Forget for Product<'a>

§

impl<'a> Freeze for Product<'a>

§

impl<'a> Move for Product<'a>

§

impl<'a> RefUnwindSafe for Product<'a>

§

impl<'a> Send for Product<'a>

§

impl<'a> Sync for Product<'a>

§

impl<'a> Unpin for Product<'a>

§

impl<'a> UnsafeUnpin for Product<'a>

§

impl<'a> UnwindSafe for Product<'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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.