Skip to content

v0.5.0

Latest
Compare
Choose a tag to compare
@robin-nitrokey robin-nitrokey released this 25 Oct 09:04
0.5.0
0a22aa1

This release contains many small changes to the public API. It also introduces the
littlefs2-core crate that can be used for crates that want to access littlefs2
filesystems without depending on a specific implementation version.

Added

  • Added object-safe traits DynFile, DynFilesystem and DynStorage for
    accessing Storage, Filesystem and File implementations for any storage.
  • Added Filesystem::mount_or_else function (#57)
  • Marked Path::is_empty, Path::from_bytes_with_nul, Path::from_cstr, Path::from_cstr_unchecked, Path::as_str_ref_with_trailing_nul, Path::as_str, and PathBuf::new as const.
  • Made fs::FileOpenFlags public and added From<fs::FileOpenFlags> for fs::OpenOptions.
  • Support platforms where c_int is not i32.

Fixed

  • Fixed macro hygiene for path!.
  • Fixed build error that would occur on Windows systems.
  • Fixed compilation without default features.
  • Added path iteration utilities (#47)

Changed

  • Enforced const evaluation for path!.
  • Removed cstr_core and cty dependencies.
  • Updated littlefs2-sys dependency to 0.2.0.
  • Replace all panicking Path/PathBuf conversions with fallible alternatives:
    • Return a Result from Path::from_str_with_nul.
    • Replace the From<_> implementations for Path and PathBuf with TryFrom<_>, except for From<&Path> for PathBuf.
  • Refactor error types:
    • Change Error enum to a struct with associated constants.
    • Remove Error::Success and enforce negative values for Error.
  • Replace Path::exists with Filesystem::exists
  • Replace DynFilesystem::open_file_with_options_and_then{,unit} with DynFilesystem::open_file_with_flags_and_then{,unit} using FileOpenFlags instead of OpenOptionsCallback
  • Refactor attributes API:
    • Change the set_attribute function in DynFilesystem and Filesystem to accept an ID and a slice instead of an Attribute.
    • Add a buffer argument to the attribute function in DynFilesystem and Filesystem and return a slice of that buffer containing the read data.
    • Change the Attribute struct to store a slice with the read data and the total size of the attribute on the filesystem.
  • Introduce object_safe::Vec trait and change DynFile::read_to_end, DynFilesystem::read and DynFilesstem::read_chunk to be generic over a Vec implementation to support multiple heapless versions (disabled by default).

Removed

  • Removed Path::from_bytes_with_nul_unchecked. Use CStr::from_bytes_with_nul_unchecked and Path::from_cstr_unchecked instead.
  • Removed From<littlefs2::path::Error> for littlefs2::io::Error.
  • Removed object_safe::OpenOptionsCallback.
  • Removed consts::ATTRBYTES_MAX_TYPE.
  • Removed dir-entry-path feature (now always enabled).