#[repr(transparent)]pub struct ReadWrite<T: Copy + FromBytes + Immutable + IntoBytes>(pub T);Expand description
A configuration space register which the driver may both read and write.
Tuple Fields§
§0: TImplementations§
Trait Implementations§
Source§impl<T> FromBytes for ReadWrite<T>
impl<T> FromBytes for ReadWrite<T>
Source§impl<T> FromZeros for ReadWrite<T>
impl<T> FromZeros for ReadWrite<T>
Source§fn new_zeroed() -> Selfwhere
Self: Sized,
fn new_zeroed() -> Selfwhere
Self: Sized,
Creates an instance of
Self from zeroed bytes. Read moreSource§fn new_box_zeroed() -> Result<Box<Self>, AllocError>where
Self: Sized,
fn new_box_zeroed() -> Result<Box<Self>, AllocError>where
Self: Sized,
Available on crate features
alloc only.Creates a
Box<Self> from zeroed bytes. Read moreSource§fn new_vec_zeroed(len: usize) -> Result<Vec<Self>, AllocError>where
Self: Sized,
fn new_vec_zeroed(len: usize) -> Result<Vec<Self>, AllocError>where
Self: Sized,
Available on crate feature
alloc only.Creates a
Vec<Self> from zeroed bytes. Read moreSource§fn extend_vec_zeroed(
v: &mut Vec<Self>,
additional: usize,
) -> Result<(), AllocError>where
Self: Sized,
fn extend_vec_zeroed(
v: &mut Vec<Self>,
additional: usize,
) -> Result<(), AllocError>where
Self: Sized,
Available on non-
no_zerocopy_panic_in_const_and_vec_try_reserve_1_57_0 and crate feature alloc only.Extends a
Vec<Self> by pushing additional new items onto the end of
the vector. The new items are initialized with zeros.Source§fn insert_vec_zeroed(
v: &mut Vec<Self>,
position: usize,
additional: usize,
) -> Result<(), AllocError>where
Self: Sized,
fn insert_vec_zeroed(
v: &mut Vec<Self>,
position: usize,
additional: usize,
) -> Result<(), AllocError>where
Self: Sized,
Available on non-
no_zerocopy_panic_in_const_and_vec_try_reserve_1_57_0 and crate feature alloc only.Inserts
additional new items into Vec<Self> at position. The new
items are initialized with zeros. Read moreSource§impl<T> IntoBytes for ReadWrite<T>
impl<T> IntoBytes for ReadWrite<T>
Source§fn as_mut_bytes(&mut self) -> &mut [u8]where
Self: FromBytes,
fn as_mut_bytes(&mut self) -> &mut [u8]where
Self: FromBytes,
Gets the bytes of this value mutably. Read more
Source§fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
Source§impl<T> TryFromBytes for ReadWrite<T>
impl<T> TryFromBytes for ReadWrite<T>
Source§fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
Source§fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
Source§fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
impl<T: Copy + FromBytes + Immutable + IntoBytes> ConfigReadable<T> for ReadWrite<T>
impl<T: Copy + FromBytes + Immutable + IntoBytes> ConfigWritable<T> for ReadWrite<T>
impl<T> Immutable for ReadWrite<T>
Auto Trait Implementations§
impl<T> Freeze for ReadWrite<T>where
T: Freeze,
impl<T> RefUnwindSafe for ReadWrite<T>where
T: RefUnwindSafe,
impl<T> Send for ReadWrite<T>where
T: Send,
impl<T> Sync for ReadWrite<T>where
T: Sync,
impl<T> Unpin for ReadWrite<T>where
T: Unpin,
impl<T> UnsafeUnpin for ReadWrite<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ReadWrite<T>where
T: UnwindSafe,
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