Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/pager/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ impl<V: Vfs> Pager<V> {
&self.vfs
}

#[allow(clippy::unused_async)]
#[allow(clippy::unused_async, clippy::unused_async_trait_impl)]
pub async fn open(vfs: V, mk: MasterKey, cfg: PagerConfig) -> Result<Self> {
let inner = Arc::new(PagerInner {
buffer_pool: parking_lot::Mutex::new(PageCache::with_capacity(cfg.buffer_pool_pages)),
Expand Down Expand Up @@ -542,7 +542,7 @@ impl<V: Vfs> Pager<V> {
/// Write (insert into cache as dirty) a main.db page. The copy-on-write caller has
/// already chosen `page_id`. `body_plain` is the plaintext payload
/// (length must equal `page_size - 40`).
#[allow(clippy::unused_async)]
#[allow(clippy::unused_async, clippy::unused_async_trait_impl)]
pub async fn write_main_page(
&self,
page_id: u64,
Expand All @@ -567,7 +567,7 @@ impl<V: Vfs> Pager<V> {
/// page 0 is the segment header, allocated separately by the segment
/// writer in a later slice). Test-only; see [`Self::read_segment_page`].
#[cfg(test)]
#[allow(clippy::unused_async)]
#[allow(clippy::unused_async, clippy::unused_async_trait_impl)]
pub async fn append_segment_page(
&self,
segment_id: [u8; 16],
Expand Down Expand Up @@ -610,7 +610,7 @@ impl<V: Vfs> Pager<V> {
/// native-only (filesystem-backed VFS root); on wasm32 it never compiles
/// in, leaving this unreachable there.
#[cfg(not(target_arch = "wasm32"))]
#[allow(clippy::unused_async)]
#[allow(clippy::unused_async, clippy::unused_async_trait_impl)]
pub async fn stage_journal_page(
&self,
journal_id: [u8; 16],
Expand Down
4 changes: 4 additions & 0 deletions src/vfs/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ pub struct MemFile {
writable: bool,
}

// These methods implement an async storage contract. Some finish immediately
// in memory, but keeping the trait-shaped futures avoids a backend-specific API.
#[allow(clippy::unused_async_trait_impl)]
impl Vfs for MemVfs {
type File = MemFile;
type LockHandle = MemLockHandle;
Expand Down Expand Up @@ -221,6 +224,7 @@ impl Vfs for MemVfs {
}
}

#[allow(clippy::unused_async_trait_impl)]
impl VfsFile for MemFile {
async fn read_at(&self, offset: u64, buf: &mut [u8]) -> Result<usize> {
let inode = self.inode.lock();
Expand Down
4 changes: 4 additions & 0 deletions src/vfs/opfs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ mod shim {

pub struct OpfsFileShim;

// The native shim preserves the async VFS surface while refusing every
// operation immediately.
#[allow(clippy::unused_async_trait_impl)]
impl VfsFile for OpfsFileShim {
async fn read_at(&self, _offset: u64, _buf: &mut [u8]) -> Result<usize> {
Err(PagedbError::Unsupported)
Expand Down Expand Up @@ -114,6 +117,7 @@ mod shim {
/// Unreachable lock handle for the native shim.
pub struct OpfsLockHandleShim(());

#[allow(clippy::unused_async_trait_impl)]
impl Vfs for OpfsVfs {
type File = OpfsFileShim;
type LockHandle = OpfsLockHandleShim;
Expand Down
2 changes: 2 additions & 0 deletions src/vfs/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,8 @@ mod tests {
}
}

// This synchronous test double implements the production async contract.
#[allow(clippy::unused_async_trait_impl)]
impl VfsFile for ScriptedWriteFile {
async fn read_at(&self, _offset: u64, _buf: &mut [u8]) -> crate::Result<usize> {
unimplemented!("read_at is not used by write_all_at tests")
Expand Down
4 changes: 4 additions & 0 deletions src/vfs/wasi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,9 @@ mod shim {

pub struct WasiFileShim;

// The non-WASI shim preserves the async VFS surface while refusing every
// operation immediately.
#[allow(clippy::unused_async_trait_impl)]
impl VfsFile for WasiFileShim {
async fn read_at(&self, _offset: u64, _buf: &mut [u8]) -> Result<usize> {
Err(PagedbError::Unsupported)
Expand Down Expand Up @@ -492,6 +495,7 @@ mod shim {
/// Unreachable lock handle for the non-WASI shim.
pub struct WasiLockHandleShim(());

#[allow(clippy::unused_async_trait_impl)]
impl Vfs for WasiVfs {
type File = WasiFileShim;
type LockHandle = WasiLockHandleShim;
Expand Down