Skip to content

Commit d75eb0f

Browse files
committed
document that async File & Volume must be explicitly closed
1 parent 42ad016 commit d75eb0f

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/inner/filesystem/files.rs

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ impl RawFile {
4848
/// If you drop a value of this type, it closes the file automatically, and but
4949
/// error that may occur will be ignored. To handle potential errors, use
5050
/// the [`File::close`] method.
51+
///
52+
/// For async Files, async drop does not exist in Rust, so you *must* call
53+
/// [`File::close`] when you are done with a File.
5154
pub struct File<'a, D, T, const MAX_DIRS: usize, const MAX_FILES: usize, const MAX_VOLUMES: usize>
5255
where
5356
D: BlockDevice,

src/inner/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ impl RawVolume {
209209
/// If you drop a value of this type, it closes the volume automatically, but
210210
/// any error that may occur will be ignored. To handle potential errors, use
211211
/// the [`Volume::close`] method.
212+
///
213+
/// For async Volumes, async drop does not exist in Rust, so you *must* call
214+
/// [`Volume::close`] when you are done with a Volume.
212215
pub struct Volume<'a, D, T, const MAX_DIRS: usize, const MAX_FILES: usize, const MAX_VOLUMES: usize>
213216
where
214217
D: BlockDevice,

0 commit comments

Comments
 (0)