Struct capsules_core::virtualizers::virtual_flash::FlashUser

source ·
pub struct FlashUser<'a, F: Flash + 'static> { /* private fields */ }
Expand description

Keep state for each flash user. All uses of the virtualized flash interface need to create one of these to be a user of the flash. The new() function handles most of the work, a user only has to pass in a reference to the MuxFlash object.

Implementations§

source§

impl<'a, F: Flash> FlashUser<'a, F>

source

pub fn new(mux: &'a MuxFlash<'a, F>) -> FlashUser<'a, F>

Trait Implementations§

source§

impl<'a, F: Flash> Client<F> for FlashUser<'a, F>

source§

fn read_complete( &self, pagebuffer: &'static mut F::Page, result: Result<(), Error>, )

Flash read complete.
source§

fn write_complete( &self, pagebuffer: &'static mut F::Page, result: Result<(), Error>, )

Flash write complete.
source§

fn erase_complete(&self, result: Result<(), Error>)

Flash erase complete.
source§

impl<F: Flash> Flash for FlashUser<'_, F>

§

type Page = <F as Flash>::Page

Type of a single flash page for the given implementation.
source§

fn read_page( &self, page_number: usize, buf: &'static mut Self::Page, ) -> Result<(), (ErrorCode, &'static mut Self::Page)>

Read a page of flash into the buffer.
source§

fn write_page( &self, page_number: usize, buf: &'static mut Self::Page, ) -> Result<(), (ErrorCode, &'static mut Self::Page)>

Write a page of flash from the buffer.
source§

fn erase_page(&self, page_number: usize) -> Result<(), ErrorCode>

Erase a page of flash by setting every byte to 0xFF.
source§

impl<'a, F: Flash, C: Client<Self>> HasClient<'a, C> for FlashUser<'a, F>

source§

fn set_client(&'a self, client: &'a C)

Set the client for this flash peripheral. The client will be called when operations complete.
source§

impl<'a, F: Flash> ListNode<'a, FlashUser<'a, F>> for FlashUser<'a, F>

source§

fn next(&'a self) -> &'a ListLink<'a, FlashUser<'a, F>>

Auto Trait Implementations§

§

impl<'a, F> !Freeze for FlashUser<'a, F>

§

impl<'a, F> !RefUnwindSafe for FlashUser<'a, F>

§

impl<'a, F> !Send for FlashUser<'a, F>

§

impl<'a, F> !Sync for FlashUser<'a, F>

§

impl<'a, F> Unpin for FlashUser<'a, F>

§

impl<'a, F> !UnwindSafe for FlashUser<'a, F>

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
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.

source§

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

§

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>,

§

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.