pub struct Region<const SIZE: usize = 0> { /* private fields */ }Expand description
Untyped I/O region.
This type can be used when an I/O region without known type information has a compile-time known minimum size (and a runtime known actual size).
§Invariants
- Size of the region is at least as large as the
SIZEgeneric parameter. - Size of the region is multiple of 4.
Implementations§
Source§impl<const SIZE: usize> Region<SIZE>
impl<const SIZE: usize> Region<SIZE>
Sourcepub fn ptr_from_raw_parts_mut(base: *mut u8, size: usize) -> *mut Self
pub fn ptr_from_raw_parts_mut(base: *mut u8, size: usize) -> *mut Self
Create a raw mutable pointer from given base address and size.
size should be at least as large as the minimum size SIZE, and base and size should
be 4-byte aligned to uphold the type invariant.
Just like other methods on raw pointers, it is not unsafe to create a raw pointer that does not uphold the type invariants. However such pointers are not valid.
Trait Implementations§
impl<const SIZE: usize> FromBytes for Region<SIZE>
Source§impl<const SIZE: usize, T> IoLoc<Region<SIZE>, T> for ()where
T: FixedRegister,
Allows () to be used as the location parameter of Io::write when
passing a FixedRegister value.
impl<const SIZE: usize, T> IoLoc<Region<SIZE>, T> for ()where
T: FixedRegister,
Allows () to be used as the location parameter of Io::write when
passing a FixedRegister value.
Source§impl<const SIZE: usize, T> IoLoc<Region<SIZE>, T> for Twhere
T: FixedRegister,
A FixedRegister carries its location in its type. Thus FixedRegister values can be used
as an IoLoc.
impl<const SIZE: usize, T> IoLoc<Region<SIZE>, T> for Twhere
T: FixedRegister,
A FixedRegister carries its location in its type. Thus FixedRegister values can be used
as an IoLoc.
Source§impl<const SIZE: usize, T> IoLoc<Region<SIZE>, T> for FixedRegisterLoc<T>where
T: FixedRegister,
impl<const SIZE: usize, T> IoLoc<Region<SIZE>, T> for FixedRegisterLoc<T>where
T: FixedRegister,
Source§impl<const SIZE: usize, T> IoLoc<Region<SIZE>, T> for RegisterArrayLoc<T>where
T: RegisterArray,
impl<const SIZE: usize, T> IoLoc<Region<SIZE>, T> for RegisterArrayLoc<T>where
T: RegisterArray,
Source§impl<const SIZE: usize, T> LocatedRegister<Region<SIZE>> for Twhere
T: FixedRegister,
impl<const SIZE: usize, T> LocatedRegister<Region<SIZE>> for Twhere
T: FixedRegister,
Source§type Location = FixedRegisterLoc<<T as LocatedRegister<Region<SIZE>>>::Value>
type Location = FixedRegisterLoc<<T as LocatedRegister<Region<SIZE>>>::Value>
Full location information at which to write the value.
Source§fn into_io_op(self) -> (FixedRegisterLoc<T>, T)
fn into_io_op(self) -> (FixedRegisterLoc<T>, T)
Consumes
self and returns a (location, value) tuple describing a valid I/O write
operation.impl<const SIZE: usize> TryFromBytes for Region<SIZE>where
[u8]: TryFromBytes,
Auto Trait Implementations§
impl<const SIZE: usize = 0> !Sized for Region<SIZE>
impl<const SIZE: usize> Freeze for Region<SIZE>
impl<const SIZE: usize> RefUnwindSafe for Region<SIZE>
impl<const SIZE: usize> Send for Region<SIZE>
impl<const SIZE: usize> Sync for Region<SIZE>
impl<const SIZE: usize> Unpin for Region<SIZE>
impl<const SIZE: usize> UnsafeUnpin for Region<SIZE>
impl<const SIZE: usize> UnwindSafe for Region<SIZE>
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