Struct smbioslib::strings::SMBiosString

source ·
pub struct SMBiosString { /* private fields */ }
Expand description

§SMBiosString

Contains the retrival result for an SMBIOS string field.

Implementations§

source§

impl SMBiosString

source

pub fn to_utf8_lossy(&self) -> Option<String>

Produces a UTF-8 which includes invalid UTF-8 characters; otherwise, returns Option::None for all other conditions.

source

pub const fn is_ok(&self) -> bool

Returns true if the result is Ok.

source

pub const fn is_err(&self) -> bool

Returns true if the result is Err.

source

pub fn ok(self) -> Option<String>

Converts to Option<String> consuming self, and discarding the error, if any.

source

pub fn err(self) -> Option<SMBiosStringError>

Converts to Option<SMBiosStringError> consuming self, and discarding the success value, if any.

source

pub const fn as_ref(&self) -> Result<&String, &SMBiosStringError>

Produces a new Result, containing a reference into the original, leaving the original in place.

source

pub fn as_mut(&mut self) -> Result<&mut String, &mut SMBiosStringError>

Converts to Result<&mut String, &mut SMBiosStringError>.

Trait Implementations§

source§

impl Debug for SMBiosString

source§

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

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

impl Display for SMBiosString

source§

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

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

impl From<Result<String, SMBiosStringError>> for SMBiosString

source§

fn from(data: Result<String, SMBiosStringError>) -> Self

Converts to this type from the input type.
source§

impl Serialize for SMBiosString

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

source§

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

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.