Struct SerialSettingsPlatform

Source
pub struct SerialSettingsPlatform<C, F, S> {
    pub interface: BestEffortInterface<S>,
    pub _settings_marker: PhantomData<C>,
    pub storage: F,
    pub metadata: &'static ApplicationMetadata,
}

Fields§

§interface: BestEffortInterface<S>

The interface to read/write data to/from serially (via text) to the user.

§_settings_marker: PhantomData<C>§storage: F

The storage mechanism used to persist settings to between boots.

§metadata: &'static ApplicationMetadata

Metadata associated with the application

Implementations§

Source§

impl<C, F, S> SerialSettingsPlatform<C, F, S>
where C: TreeDeserializeOwned + TreeSerialize + TreeSchema, F: NorFlash,

Source

pub fn load(structure: &mut C, storage: &mut F)

Trait Implementations§

Source§

impl<C, F, S> Platform for SerialSettingsPlatform<C, F, S>
where C: Settings, F: NorFlash, S: EioWrite + WriteReady + ReadReady + EioRead,

Source§

type Interface = BestEffortInterface<S>

This type specifies the interface to the user, for example, a USB CDC-ACM serial port.
Source§

type Settings = C

Source§

type Error = Error<<F as ErrorType>::Error>

Source§

fn fetch<'a>( &mut self, buf: &'a mut [u8], key: &[u8], ) -> Result<Option<&'a [u8]>, Self::Error>

Fetch a value from persisten storage
Source§

fn store( &mut self, buf: &mut [u8], key: &[u8], value: &[u8], ) -> Result<(), Self::Error>

Store a value to persistent storage
Source§

fn clear(&mut self, buf: &mut [u8], key: &[u8]) -> Result<(), Self::Error>

Remove a key from storage.
Source§

fn cmd(&mut self, cmd: &str)

Execute a platform specific command.
Source§

fn interface_mut(&mut self) -> &mut Self::Interface

Return a mutable reference to the Interface.

Auto Trait Implementations§

§

impl<C, F, S> Freeze for SerialSettingsPlatform<C, F, S>
where F: Freeze, S: Freeze,

§

impl<C, F, S> RefUnwindSafe for SerialSettingsPlatform<C, F, S>

§

impl<C, F, S> Send for SerialSettingsPlatform<C, F, S>
where F: Send, S: Send, C: Send,

§

impl<C, F, S> Sync for SerialSettingsPlatform<C, F, S>
where F: Sync, S: Sync, C: Sync,

§

impl<C, F, S> Unpin for SerialSettingsPlatform<C, F, S>
where F: Unpin, S: Unpin, C: Unpin,

§

impl<C, F, S> UnwindSafe for SerialSettingsPlatform<C, F, S>
where F: UnwindSafe, S: UnwindSafe, C: 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, 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.