P1: AsyncLocalFs implementation (Phase 2)
Some checks failed
Test / test (push) Has been cancelled
Test / build (push) Has been cancelled

- AsyncLocalFile: tokio::fs::File wrapper
- AsyncLocalFs: AsyncVfsBackend impl using tokio::fs
- Key methods: read_dir, open_file, stat, create_dir, remove_file, rename
- 4 async tests passing

Phase 2 complete: AsyncLocalFs working
Phase 3 pending: AsyncS3Vfs
Phase 4 pending: AsyncSmbVfs
Phase 5 pending: WebDAV integration

Tests: 293 passed, 0 failed
This commit is contained in:
Warren
2026-06-21 20:59:41 +08:00
parent 6242a5eaab
commit 790efe13f4
2 changed files with 252 additions and 1 deletions

View File

@@ -8,6 +8,8 @@ pub mod smb_fs;
#[cfg(feature = "smb-server")]
pub mod smb_server_backend;
pub mod util;
#[cfg(feature = "async-vfs")]
pub mod async_fs;
use std::path::{Path, PathBuf};
use std::time::SystemTime;
@@ -567,7 +569,7 @@ pub trait AsyncVfsFile: Send + Sync {
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> std::pin::Pin<Box<dyn std::future::Future<Output = Result<usize, VfsError>> + Send + 'a>>;
fn write<'a>(&'a mut self, buf: &'a [u8]) -> std::pin::Pin<Box<dyn std::future::Future<Output = Result<usize, VfsError>> + Send + 'a>>;
fn seek<'a>(&'a mut self, pos: std::io::SeekFrom) -> std::pin::Pin<Box<dyn std::future::Future<Output = Result<u64, VfsError>> + Send + 'a>>;
fn flush(&mut self) -> std::pin::Pin<Box<dyn std::future::Future<Output = Result<(), VfsError>> + Send>>;
fn flush<'a>(&'a mut self) -> std::pin::Pin<Box<dyn std::future::Future<Output = Result<(), VfsError>> + Send + 'a>>;
}
/// Async VFS 后端 trait用于异步文件系统操作