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 strVendorName (§11.1.5.2).
vendor_id: VendorIdVendorID (§11.1.5.3).
product_name: &'a strProductName (§11.1.5.4).
product_id: u16ProductID (§11.1.5.5).
hardware_version: u16HardwareVersion (§11.1.5.8).
hardware_version_string: &'a strHardwareVersionString (§11.1.5.9), 1 to 64 characters.
software_version: u32SoftwareVersion (§11.1.5.10).
software_version_string: &'a strSoftwareVersionString (§11.1.5.11), 1 to 64 characters.
unique_id: &'a strUniqueID (§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: CapabilityMinimaCapabilityMinima (§11.1.5.20).
max_paths_per_invoke: u16MaxPathsPerInvoke (§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: u32ConfigurationVersion (§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>
impl<'a> Product<'a>
Sourcepub const fn new(
vendor_name: &'a str,
vendor_id: VendorId,
product_name: &'a str,
product_id: u16,
unique_id: &'a str,
) -> Self
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.
Sourcepub const fn with_hardware(self, version: u16, string: &'a str) -> Self
pub const fn with_hardware(self, version: u16, string: &'a str) -> Self
The same product with hardware version information.
Sourcepub const fn with_software(self, version: u32, string: &'a str) -> Self
pub const fn with_software(self, version: u32, string: &'a str) -> Self
The same product with software version information.
Sourcepub const fn with_serial_number(self, serial_number: &'a str) -> Self
pub const fn with_serial_number(self, serial_number: &'a str) -> Self
The same product with a serial number.
Sourcepub const fn with_capability_minima(self, minima: CapabilityMinima) -> Self
pub const fn with_capability_minima(self, minima: CapabilityMinima) -> Self
The same product with CapabilityMinima.
Sourcepub const fn with_max_paths_per_invoke(self, max: u16) -> Self
pub const fn with_max_paths_per_invoke(self, max: u16) -> Self
The same product with a MaxPathsPerInvoke.