Skip to main content

FlashJournal

Struct FlashJournal 

Source
pub struct FlashJournal<F>
where F: NorFlash,
{ /* private fields */ }

Implementations§

Source§

impl<F> FlashJournal<F>
where F: NorFlash,

Source

pub async fn inspect_timebase( flash: &mut F, layout: FlashJournalLayout, ) -> Result<Option<InstantMillis>, FlashJournalError<<F as ErrorType>::Error>>

Source

pub async fn inspect_timebase_state( flash: &mut F, layout: FlashJournalLayout, ) -> Result<FlashJournalTimebaseState, FlashJournalError<<F as ErrorType>::Error>>

Source

pub async fn open( flash: F, layout: FlashJournalLayout, scratch: &mut [u8], on_record: impl FnMut(FlashJournalRecord<'_>), ) -> Result<(FlashJournal<F>, FlashJournalRestoreReport), FlashJournalError<<F as ErrorType>::Error>>

Source

pub fn release(self) -> F

Source

pub fn layout(&self) -> FlashJournalLayout

Source

pub fn active_epoch(&self) -> Option<u64>

Source

pub fn active_remaining_bytes(&self) -> Option<usize>

Source

pub fn active_can_fit(&self, payload_len: usize, reserve_bytes: usize) -> bool

Source

pub async fn initialize_empty( &mut self, ) -> Result<(), FlashJournalError<<F as ErrorType>::Error>>

Source

pub async fn append( &mut self, kind: FlashJournalRecordKind, payload: &[u8], ) -> Result<(), FlashJournalError<<F as ErrorType>::Error>>

Source

pub fn inactive_sector_count(&self) -> usize

Source

pub async fn erase_inactive_sector( &mut self, sector: usize, ) -> Result<(), FlashJournalError<<F as ErrorType>::Error>>

Source

pub fn begin_compaction( &mut self, ) -> Result<(), FlashJournalError<<F as ErrorType>::Error>>

Source

pub async fn append_compacted( &mut self, kind: FlashJournalRecordKind, payload: &[u8], ) -> Result<(), FlashJournalError<<F as ErrorType>::Error>>

Source

pub async fn commit_compaction( &mut self, ) -> Result<(), FlashJournalError<<F as ErrorType>::Error>>

Source

pub fn abort_compaction(&mut self)

Source

pub async fn timebase_high_water( &mut self, ) -> Result<Option<InstantMillis>, FlashJournalError<<F as ErrorType>::Error>>

Source

pub async fn record_timebase( &mut self, now: InstantMillis, ) -> Result<(), FlashJournalError<<F as ErrorType>::Error>>

Source

pub async fn record_compaction_budget( &mut self, attempted_at: InstantMillis, ) -> Result<InstantMillis, FlashJournalError<<F as ErrorType>::Error>>

Auto Trait Implementations§

§

impl<F> Freeze for FlashJournal<F>
where F: Freeze,

§

impl<F> RefUnwindSafe for FlashJournal<F>
where F: RefUnwindSafe,

§

impl<F> Send for FlashJournal<F>
where F: Send,

§

impl<F> Sync for FlashJournal<F>
where F: Sync,

§

impl<F> Unpin for FlashJournal<F>
where F: Unpin,

§

impl<F> UnsafeUnpin for FlashJournal<F>
where F: UnsafeUnpin,

§

impl<F> UnwindSafe for FlashJournal<F>
where F: 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
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> Same for T

Source§

type Output = T

Should always be Self
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.