Skip to content

Commit 5f270ac

Browse files
committed
document requirement of generic-queue-x for async drop
1 parent 418310b commit 5f270ac

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/inner/filesystem/files.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,13 @@ impl RawFile {
5050
/// the [`File::close`] method.
5151
///
5252
/// For async `Files`, the implementation of [`Drop`] blocks with [`embassy_futures::block_on`]
53-
/// because there is no way to `.await` inside [`Drop::drop`]. If you would prefer
54-
/// to rely on the async executor you are already using, call [`File::close`]
55-
/// manually instead of letting the `File` drop.
53+
/// because there is no way to `.await` inside [`Drop::drop`]. Note that if you are using the
54+
/// [Embassy](https://embassy.dev) async executor, you must enable a
55+
/// [`generic-queue-x`](https://docs.rs/embassy-time/latest/embassy_time/#generic-queue)
56+
/// feature of the embassy-time crate or dropping a `File` will panic. If you would prefer
57+
/// to rely on the async executor you are already using, or avoid the requirement to
58+
/// use embassy-time's `generic-queue-x` feature, call [`File::close`] manually instead
59+
/// of letting the `File` drop.
5660
pub struct File<'a, D, T, const MAX_DIRS: usize, const MAX_FILES: usize, const MAX_VOLUMES: usize>
5761
where
5862
D: BlockDevice,

src/inner/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,13 @@ impl RawVolume {
211211
/// the [`Volume::close`] method.
212212
///
213213
/// For async `Volumes`, the implementation of [`Drop`] blocks with [`embassy_futures::block_on`]
214-
/// because there is no way to `.await` inside [`Drop::drop`]. If you would prefer
215-
/// to rely on the async executor you are already using, call [`Volume::close`]
216-
/// manually instead of letting the `Volume` drop.
214+
/// because there is no way to `.await` inside [`Drop::drop`]. Note that if you are using the
215+
/// [Embassy](https://embassy.dev) async executor, you must enable a
216+
/// [`generic-queue-x`](https://docs.rs/embassy-time/latest/embassy_time/#generic-queue)
217+
/// feature of the embassy-time crate or dropping a `Volume` will panic. If you would prefer
218+
/// to rely on the async executor you are already using, or avoid the requirement to
219+
/// use embassy-time's `generic-queue-x` feature, call [`Volume::close`] manually instead
220+
/// of letting the `Volume` drop.
217221
pub struct Volume<'a, D, T, const MAX_DIRS: usize, const MAX_FILES: usize, const MAX_VOLUMES: usize>
218222
where
219223
D: BlockDevice,

0 commit comments

Comments
 (0)