Skip to main content

HramCell

Struct HramCell 

Source
pub struct HramCell<T>(/* private fields */)
where
    T: CellValue;
Expand description

Storage for a cell read and written under a CriticalSection.

Declare it with hram!; the accessors live on the handle that macro generates, not on this type. An access wider than one byte is several ldh instructions, and the token is the proof that no interrupt lands between them.

Implementations§

Source§

impl<T> HramCell<T>
where T: CellValue,

Source

pub const unsafe fn uninit() -> HramCell<T>

Reserve a cell.

§Safety

The cell must come to rest at an address in 0xFF80..=0xFFFE. hram! guarantees this; a hand-placed cell needs #[link_section = "_HRAM.*"].

Source

pub const fn ptr(&self) -> *mut T

The cell’s address as a raw pointer.

Trait Implementations§

Source§

impl<T> Sync for HramCell<T>
where T: CellValue,

Auto Trait Implementations§

§

impl<T> !Freeze for HramCell<T>

§

impl<T> !RefUnwindSafe for HramCell<T>

§

impl<T> BankSafe for HramCell<T>

§

impl<T> Send for HramCell<T>
where T: Send,

§

impl<T> Unpin for HramCell<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for HramCell<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for HramCell<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.