pub struct PciInfoErrorString(/* private fields */);
Expand description
A string type used to optimize size and various operations on the error types of this crate.
§Examples
This shows some conversions to &str
and String
using different methods:
let errs: PciInfoErrorString = "test".into();
// Convert to a String calling `to_string()`
let s: String = errs.to_string();
assert_eq!(s, "test");
// Convert to a String calling `into()`
let errs2 = errs.clone();
let s: String = errs2.into();
assert_eq!(s, "test");
// Convert to a &str calling `into()` on a `&PciInfoErrorString`
let s: &str = (&errs).into();
assert_eq!(s, "test");
// Convert to a &str calling `as_str()`
let s: &str = errs.as_str();
assert_eq!(s, "test");
// Use the `Display` trait
let s = format!("{errs}");
assert_eq!(s, "test");
// Use the `Debug` trait
let s = format!("{errs:?}");
assert_eq!(s, "\"test\"");
Implementations§
Trait Implementations§
Source§impl Clone for PciInfoErrorString
impl Clone for PciInfoErrorString
Source§fn clone(&self) -> PciInfoErrorString
fn clone(&self) -> PciInfoErrorString
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PciInfoErrorString
impl Debug for PciInfoErrorString
Source§impl Display for PciInfoErrorString
impl Display for PciInfoErrorString
Source§impl<'a> From<&'a PciInfoErrorString> for &'a str
impl<'a> From<&'a PciInfoErrorString> for &'a str
Source§fn from(value: &'a PciInfoErrorString) -> Self
fn from(value: &'a PciInfoErrorString) -> Self
Converts to this type from the input type.
Source§impl From<&'static str> for PciInfoErrorString
impl From<&'static str> for PciInfoErrorString
Source§impl From<PciInfoErrorString> for String
impl From<PciInfoErrorString> for String
Source§fn from(value: PciInfoErrorString) -> Self
fn from(value: PciInfoErrorString) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PciInfoErrorString
impl RefUnwindSafe for PciInfoErrorString
impl Send for PciInfoErrorString
impl Sync for PciInfoErrorString
impl Unpin for PciInfoErrorString
impl UnwindSafe for PciInfoErrorString
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more