pub struct OveralignedVolatilePtr<'a, T, F, A>{ /* private fields */ }
Expand description
An overaligned volatile pointer for fields that require wider access operations.
In virtio, some fields require wider access operations than their type indicate, such as for mmio::DeviceRegisters
.
Implementations§
Source§impl<'a, T, F, A> OveralignedVolatilePtr<'a, T, F, A>where
T: OveralignedField<F>,
F: Copy,
impl<'a, T, F, A> OveralignedVolatilePtr<'a, T, F, A>where
T: OveralignedField<F>,
F: Copy,
Sourcepub fn new(ptr: VolatilePtr<'a, F, A>) -> Self
pub fn new(ptr: VolatilePtr<'a, F, A>) -> Self
Creates a new overaligned volatile pointer.
Sourcepub fn read(self) -> Twhere
A: Readable,
pub fn read(self) -> Twhere
A: Readable,
Performs a volatile read of the contained value.
See VolatilePtr::read
.
Sourcepub fn write(self, value: T)where
A: Writable,
pub fn write(self, value: T)where
A: Writable,
Performs a volatile write, setting the contained value to the given value
.
See VolatilePtr::write
.
Trait Implementations§
Source§impl<'a, T, F, A> Clone for OveralignedVolatilePtr<'a, T, F, A>
impl<'a, T, F, A> Clone for OveralignedVolatilePtr<'a, T, F, A>
impl<'a, T, F, A> Copy for OveralignedVolatilePtr<'a, T, F, A>
Auto Trait Implementations§
impl<'a, T, F, A> Freeze for OveralignedVolatilePtr<'a, T, F, A>
impl<'a, T, F, A> RefUnwindSafe for OveralignedVolatilePtr<'a, T, F, A>
impl<'a, T, F, A> !Send for OveralignedVolatilePtr<'a, T, F, A>
impl<'a, T, F, A> !Sync for OveralignedVolatilePtr<'a, T, F, A>
impl<'a, T, F, A> Unpin for OveralignedVolatilePtr<'a, T, F, A>
impl<'a, T, F, A> UnwindSafe for OveralignedVolatilePtr<'a, T, F, A>
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