Skip to main content

Identity

Struct Identity 

Source
#[non_exhaustive]
pub struct Identity { pub mfg_name: Option<String>, pub model_name: Option<String>, pub serial_num: Option<String>, pub hardware_rev: Option<String>, pub firmware_rev: Option<String>, pub software_rev: Option<String>, pub imei: Option<String>, }
Expand description

What a device is, with RFC 8348’s field names (#122).

Every field optional and the type #[non_exhaustive]: a device says what it knows, and a field arrives when a device produces it. Subscriber identifiers never appear here — an IMSI, an ICCID, an MSISDN identifies a person’s subscription, not equipment (invariant I5). The equipment identifier does, because the gateway keys its endpoints by it; it is an addressing identifier, never a proof of identity.

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.
§mfg_name: Option<String>

Who made it.

§model_name: Option<String>

What it is, in the maker’s words.

§serial_num: Option<String>

The maker’s serial number.

§hardware_rev: Option<String>

Hardware revision.

§firmware_rev: Option<String>

Firmware revision.

§software_rev: Option<String>

Software revision, where it is distinct from the firmware’s.

§imei: Option<String>

The bearer’s equipment identifier — an IMEI.

Implementations§

Source§

impl Identity

Source

pub fn unknown() -> Self

A device that knows nothing about itself.

Source

pub fn is_empty(&self) -> bool

Whether the device said anything at all.

Source

pub fn mfg_name(self, v: impl Into<String>) -> Self

With the maker’s name.

Source

pub fn model_name(self, v: impl Into<String>) -> Self

With the model name.

Source

pub fn serial_num(self, v: impl Into<String>) -> Self

With the serial number.

Source

pub fn hardware_rev(self, v: impl Into<String>) -> Self

With the hardware revision.

Source

pub fn firmware_rev(self, v: impl Into<String>) -> Self

With the firmware revision.

Source

pub fn software_rev(self, v: impl Into<String>) -> Self

With the software revision.

Source

pub fn imei(self, v: impl Into<String>) -> Self

With the equipment identifier.

Trait Implementations§

Source§

impl Clone for Identity

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 Debug for Identity

Source§

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

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

impl Default for Identity

Source§

fn default() -> Self

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

impl Eq for Identity

Source§

impl PartialEq for Identity

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 StructuralPartialEq for Identity

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