Struct embedded_sdmmc::RawDirectory
source · pub struct RawDirectory(/* private fields */);
Expand description
Represents an open directory on disk.
Do NOT drop this object! It doesn’t hold a reference to the Volume Manager it was created from and if you drop it, the VolumeManager will think you still have the directory open, and it won’t let you open the directory again.
Instead you must pass it to crate::VolumeManager::close_dir
to close it
cleanly.
If you want your directories to close themselves on drop, create your own
Directory
type that wraps this one and also holds a VolumeManager
reference. You’ll then also need to put your VolumeManager
in some kind of
Mutex or RefCell, and deal with the fact you can’t put them both in the same
struct any more because one refers to the other. Basically, it’s complicated
and there’s a reason we did it this way.
Implementations§
source§impl RawDirectory
impl RawDirectory
sourcepub fn to_directory<D, T, const MAX_DIRS: usize, const MAX_FILES: usize, const MAX_VOLUMES: usize>(
self,
volume_mgr: &mut VolumeManager<D, T, MAX_DIRS, MAX_FILES, MAX_VOLUMES>
) -> Directory<'_, D, T, MAX_DIRS, MAX_FILES, MAX_VOLUMES>where
D: BlockDevice,
T: TimeSource,
pub fn to_directory<D, T, const MAX_DIRS: usize, const MAX_FILES: usize, const MAX_VOLUMES: usize>(
self,
volume_mgr: &mut VolumeManager<D, T, MAX_DIRS, MAX_FILES, MAX_VOLUMES>
) -> Directory<'_, D, T, MAX_DIRS, MAX_FILES, MAX_VOLUMES>where
D: BlockDevice,
T: TimeSource,
Convert a raw directory into a droppable Directory
Trait Implementations§
source§impl Clone for RawDirectory
impl Clone for RawDirectory
source§fn clone(&self) -> RawDirectory
fn clone(&self) -> RawDirectory
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RawDirectory
impl Debug for RawDirectory
source§impl PartialEq for RawDirectory
impl PartialEq for RawDirectory
source§fn eq(&self, other: &RawDirectory) -> bool
fn eq(&self, other: &RawDirectory) -> bool
self
and other
values to be equal, and is used
by ==
.