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

Get metadata about the settings structure.

Provided Methods

Update settings directly from a string path and data.

Args
  • path - The path to update within settings.
  • data - The serialized data making up the contents of the configured value.
Returns

The result of the configuration operation.

Retrieve a serialized settings value from a string path.

Args
  • path - The path to retrieve.
  • data - The location to serialize the data into.
Returns

The number of bytes used in the data buffer for serialization.

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.

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.

Implementations on Foreign Types

Implementors