Skip to main content

Config

Struct Config 

Source
pub struct Config {
    pub block_size: u32,
    pub block_count: u32,
    pub read_size: u32,
    pub prog_size: u32,
    pub block_cycles: i32,
    pub cache_size: u32,
    pub lookahead_size: u32,
    pub name_max: u32,
    pub file_max: u32,
    pub attr_max: u32,
}
Expand description

Filesystem configuration.

Only block_size and block_count are required; the rest have sensible defaults. Create with Config::new and override fields as needed.

Fields§

§block_size: u32

Size of an erasable block in bytes.

§block_count: u32

Number of erasable blocks on the device.

§read_size: u32

Minimum read size in bytes. Defaults to 16.

§prog_size: u32

Minimum program (write) size in bytes. Defaults to 16.

§block_cycles: i32

Number of erase cycles before moving data to a new block. Set to -1 to disable wear leveling.

§cache_size: u32

Size of per-file caches in bytes. 0 (default) uses block_size.

§lookahead_size: u32

Size of the block allocator lookahead buffer in bytes. 0 (default) uses block_size. Must be a multiple of 8.

§name_max: u32

Maximum file name length in bytes. Defaults to 255.

§file_max: u32

Maximum file size in bytes.

§attr_max: u32

Maximum size of custom attributes in bytes.

Implementations§

Source§

impl Config

Source

pub fn new(block_size: u32, block_count: u32) -> Self

Create a configuration with the given block geometry and sensible defaults for everything else.

Auto Trait Implementations§

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.