Struct stm32wlxx_hal::flash::AlignedAddr
source · pub struct AlignedAddr { /* private fields */ }
Expand description
A u64
aligned flash address.
An argument of Flash::program_bytes
.
Example
Create an aligned flash address by converting from usize
.
use stm32wlxx_hal::flash::AlignedAddr;
let addr: AlignedAddr = AlignedAddr::try_from(0x0803_F800_usize)?;
Implementations§
source§impl AlignedAddr
impl AlignedAddr
sourcepub const unsafe fn new_unchecked(addr: usize) -> Self
pub const unsafe fn new_unchecked(addr: usize) -> Self
Create a page address from an index without checking bounds.
Safety
- The
addr
argument must be a multiple of 8. - The
addr
argument must be a valid flash address, within the range returned byflash_range
.
Example
use stm32wlxx_hal::flash::Page;
let page0 = unsafe { Page::from_index_unchecked(0) };
Trait Implementations§
source§impl Clone for AlignedAddr
impl Clone for AlignedAddr
source§fn clone(&self) -> AlignedAddr
fn clone(&self) -> AlignedAddr
Returns a copy 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 AlignedAddr
impl Debug for AlignedAddr
source§impl From<AlignedAddr> for u32
impl From<AlignedAddr> for u32
source§fn from(addr: AlignedAddr) -> Self
fn from(addr: AlignedAddr) -> Self
Converts to this type from the input type.
source§impl From<AlignedAddr> for usize
impl From<AlignedAddr> for usize
source§fn from(addr: AlignedAddr) -> Self
fn from(addr: AlignedAddr) -> Self
Converts to this type from the input type.
source§impl From<Page> for AlignedAddr
impl From<Page> for AlignedAddr
source§impl Ord for AlignedAddr
impl Ord for AlignedAddr
source§fn cmp(&self, other: &AlignedAddr) -> Ordering
fn cmp(&self, other: &AlignedAddr) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for AlignedAddr
impl PartialEq for AlignedAddr
source§fn eq(&self, other: &AlignedAddr) -> bool
fn eq(&self, other: &AlignedAddr) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for AlignedAddr
impl PartialOrd for AlignedAddr
source§fn partial_cmp(&self, other: &AlignedAddr) -> Option<Ordering>
fn partial_cmp(&self, other: &AlignedAddr) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<u32> for AlignedAddr
impl TryFrom<u32> for AlignedAddr
source§impl TryFrom<usize> for AlignedAddr
impl TryFrom<usize> for AlignedAddr
impl Copy for AlignedAddr
impl Eq for AlignedAddr
impl StructuralEq for AlignedAddr
impl StructuralPartialEq for AlignedAddr
Auto Trait Implementations§
impl RefUnwindSafe for AlignedAddr
impl Send for AlignedAddr
impl Sync for AlignedAddr
impl Unpin for AlignedAddr
impl UnwindSafe for AlignedAddr
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