Struct esp_idf_svc::nvs::EspNvs

source ·
pub struct EspNvs<T: NvsPartitionId>(/* private fields */);

Implementations§

source§

impl<T: NvsPartitionId> EspNvs<T>

source

pub fn new( partition: EspNvsPartition<T>, namespace: &str, read_write: bool, ) -> Result<Self, EspError>

source

pub fn contains(&self, name: &str) -> Result<bool, EspError>

source

pub fn remove(&mut self, name: &str) -> Result<bool, EspError>

source

pub fn get_raw<'a>( &self, name: &str, buf: &'a mut [u8], ) -> Result<Option<&'a [u8]>, EspError>

source

pub fn set_raw(&mut self, name: &str, buf: &[u8]) -> Result<bool, EspError>

source

pub fn blob_len(&self, name: &str) -> Result<Option<usize>, EspError>

source

pub fn get_blob<'a>( &self, name: &str, buf: &'a mut [u8], ) -> Result<Option<&'a [u8]>, EspError>

source

pub fn set_blob(&mut self, name: &str, buf: &[u8]) -> Result<(), EspError>

source

pub fn str_len(&self, name: &str) -> Result<Option<usize>, EspError>

source

pub fn get_str<'a>( &self, name: &str, buf: &'a mut [u8], ) -> Result<Option<&'a str>, EspError>

source

pub fn set_str(&mut self, name: &str, val: &str) -> Result<(), EspError>

source

pub fn get_u8(&self, name: &str) -> Result<Option<u8>, EspError>

source

pub fn set_u8(&self, name: &str, val: u8) -> Result<(), EspError>

source

pub fn get_i8(&self, name: &str) -> Result<Option<i8>, EspError>

source

pub fn set_i8(&self, name: &str, val: i8) -> Result<(), EspError>

source

pub fn get_u16(&self, name: &str) -> Result<Option<u16>, EspError>

source

pub fn set_u16(&self, name: &str, val: u16) -> Result<(), EspError>

source

pub fn get_i16(&self, name: &str) -> Result<Option<i16>, EspError>

source

pub fn set_i16(&self, name: &str, val: i16) -> Result<(), EspError>

source

pub fn get_u32(&self, name: &str) -> Result<Option<u32>, EspError>

source

pub fn set_u32(&self, name: &str, val: u32) -> Result<(), EspError>

source

pub fn get_i32(&self, name: &str) -> Result<Option<i32>, EspError>

source

pub fn set_i32(&self, name: &str, val: i32) -> Result<(), EspError>

source

pub fn get_u64(&self, name: &str) -> Result<Option<u64>, EspError>

source

pub fn set_u64(&self, name: &str, val: u64) -> Result<(), EspError>

source

pub fn get_i64(&self, name: &str) -> Result<Option<i64>, EspError>

source

pub fn set_i64(&self, name: &str, val: i64) -> Result<(), EspError>

Trait Implementations§

source§

impl<T: NvsPartitionId> Drop for EspNvs<T>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl RawHandle for EspNvs<NvsCustom>

§

type Handle = u32

source§

fn handle(&self) -> Self::Handle

Care should be taken to use the returned ESP-IDF driver raw handle only while the driver is still alive, so as to avoid use-after-free errors.
source§

impl RawHandle for EspNvs<NvsEncrypted>

§

type Handle = u32

source§

fn handle(&self) -> Self::Handle

Care should be taken to use the returned ESP-IDF driver raw handle only while the driver is still alive, so as to avoid use-after-free errors.
source§

impl<T: NvsPartitionId> RawStorage for EspNvs<T>

source§

fn len(&self, name: &str) -> Result<Option<usize>, Self::Error>

source§

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

source§

fn set_raw(&mut self, name: &str, buf: &[u8]) -> Result<bool, Self::Error>

source§

impl<T: NvsPartitionId> StorageBase for EspNvs<T>

§

type Error = EspError

source§

fn contains(&self, name: &str) -> Result<bool, Self::Error>

source§

fn remove(&mut self, name: &str) -> Result<bool, Self::Error>

source§

impl<T: NvsPartitionId> Send for EspNvs<T>

Auto Trait Implementations§

§

impl<T> Freeze for EspNvs<T>

§

impl<T> RefUnwindSafe for EspNvs<T>
where T: RefUnwindSafe,

§

impl<T> Sync for EspNvs<T>
where T: Sync + Send,

§

impl<T> Unpin for EspNvs<T>

§

impl<T> UnwindSafe for EspNvs<T>
where T: RefUnwindSafe,

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

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

Performs the conversion.
§

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

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

Performs the conversion.