pub trait Miniconf {
fn string_set(
&mut self,
topic_parts: Peekable<Split<'_, char>>,
value: &[u8]
) -> Result<(), Error>;
fn string_get(
&self,
topic_parts: Peekable<Split<'_, char>>,
value: &mut [u8]
) -> Result<usize, Error>;
fn get_metadata(&self) -> MiniconfMetadata;
fn recurse_paths<const TS: usize>(
&self,
index: &mut [usize],
topic: &mut String<TS>
) -> Option<()>;
fn set(&mut self, path: &str, data: &[u8]) -> Result<(), Error> { ... }
fn get(&self, path: &str, data: &mut [u8]) -> Result<usize, Error> { ... }
fn iter<'a, const TS: usize>(
&'a self,
state: &'a mut [usize]
) -> Result<MiniconfIter<'a, Self, TS>, IterError> { ... }
fn unchecked_iter<'a, const TS: usize>(
&'a self,
state: &'a mut [usize]
) -> MiniconfIter<'a, Self, TS>ⓘNotable traits for MiniconfIter<'a, Settings, TS>impl<'a, Settings: Miniconf + ?Sized, const TS: usize> Iterator for MiniconfIter<'a, Settings, TS> type Item = String<TS>; { ... }
}Expand description
Derive-able trait for structures that can be mutated using serialized paths and values.
Required Methods
fn string_set(
&mut self,
topic_parts: Peekable<Split<'_, char>>,
value: &[u8]
) -> Result<(), Error>
fn string_get(
&self,
topic_parts: Peekable<Split<'_, char>>,
value: &mut [u8]
) -> Result<usize, Error>
fn get_metadata(&self) -> MiniconfMetadata
fn get_metadata(&self) -> MiniconfMetadata
Get metadata about the settings structure.
Provided Methods
Create an iterator to read all possible settings paths.
Note
The state vector can be used to resume iteration from a previous point in time. The data should be zero-initialized if starting iteration for the first time.
Template Arguments
TS- The maximum number of bytes to encode a settings path into.
Args
state- A state vector to record iteration state in.
fn unchecked_iter<'a, const TS: usize>(
&'a self,
state: &'a mut [usize]
) -> MiniconfIter<'a, Self, TS>ⓘNotable traits for MiniconfIter<'a, Settings, TS>impl<'a, Settings: Miniconf + ?Sized, const TS: usize> Iterator for MiniconfIter<'a, Settings, TS> type Item = String<TS>;
fn unchecked_iter<'a, const TS: usize>(
&'a self,
state: &'a mut [usize]
) -> MiniconfIter<'a, Self, TS>ⓘNotable traits for MiniconfIter<'a, Settings, TS>impl<'a, Settings: Miniconf + ?Sized, const TS: usize> Iterator for MiniconfIter<'a, Settings, TS> type Item = String<TS>;
Create an iterator to read all possible settings paths.
Note
This does not check that the topic size or state vector are large enough. If they are not, panics may be generated internally by the library.
Note
The state vector can be used to resume iteration from a previous point in time. The data should be zero-initialized if starting iteration for the first time.
Template Arguments
TS- The maximum number of bytes to encode a settings path into.
Args
state- A state vector to record iteration state in.