Struct dav_server_opendalfs::OpendalFs
source · pub struct OpendalFs {
pub op: Operator,
}
Expand description
OpendalFs is a DavFileSystem
implementation for opendal.
use anyhow::Result;
use dav_server::davpath::DavPath;
use dav_server::fs::DavFileSystem;
use dav_server_opendalfs::OpendalFs;
use opendal::services::Memory;
use opendal::Operator;
#[tokio::test]
async fn test() -> Result<()> {
let op = Operator::new(Memory::default())?.finish();
let webdavfs = OpendalFs::new(op);
let metadata = webdavfs
.metadata(&DavPath::new("/").unwrap())
.await
.unwrap();
println!("{}", metadata.is_dir());
Ok(())
}
Fields§
§op: Operator
Implementations§
Trait Implementations§
source§impl DavFileSystem for OpendalFs
impl DavFileSystem for OpendalFs
source§fn open<'a>(
&'a self,
path: &'a DavPath,
options: OpenOptions,
) -> FsFuture<'a, Box<dyn DavFile>>
fn open<'a>( &'a self, path: &'a DavPath, options: OpenOptions, ) -> FsFuture<'a, Box<dyn DavFile>>
Open a file.
source§fn read_dir<'a>(
&'a self,
path: &'a DavPath,
_meta: ReadDirMeta,
) -> FsFuture<'a, FsStream<Box<dyn DavDirEntry>>>
fn read_dir<'a>( &'a self, path: &'a DavPath, _meta: ReadDirMeta, ) -> FsFuture<'a, FsStream<Box<dyn DavDirEntry>>>
Perform read_dir.
source§fn metadata<'a>(
&'a self,
path: &'a DavPath,
) -> FsFuture<'a, Box<dyn DavMetaData>>
fn metadata<'a>( &'a self, path: &'a DavPath, ) -> FsFuture<'a, Box<dyn DavMetaData>>
Return the metadata of a file or directory.
source§fn create_dir<'a>(&'a self, path: &'a DavPath) -> FsFuture<'a, ()>
fn create_dir<'a>(&'a self, path: &'a DavPath) -> FsFuture<'a, ()>
Create a directory. Read more
source§fn remove_dir<'a>(&'a self, path: &'a DavPath) -> FsFuture<'a, ()>
fn remove_dir<'a>(&'a self, path: &'a DavPath) -> FsFuture<'a, ()>
Remove a directory. Read more
source§fn remove_file<'a>(&'a self, path: &'a DavPath) -> FsFuture<'a, ()>
fn remove_file<'a>(&'a self, path: &'a DavPath) -> FsFuture<'a, ()>
Remove a file. Read more
source§fn rename<'a>(&'a self, from: &'a DavPath, to: &'a DavPath) -> FsFuture<'a, ()>
fn rename<'a>(&'a self, from: &'a DavPath, to: &'a DavPath) -> FsFuture<'a, ()>
Rename a file or directory. Read more
source§fn copy<'a>(&'a self, from: &'a DavPath, to: &'a DavPath) -> FsFuture<'a, ()>
fn copy<'a>(&'a self, from: &'a DavPath, to: &'a DavPath) -> FsFuture<'a, ()>
Copy a file Read more
§fn symlink_metadata<'a>(
&'a self,
path: &'a DavPath,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn DavMetaData>, FsError>> + Send + 'a>>
fn symlink_metadata<'a>( &'a self, path: &'a DavPath, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn DavMetaData>, FsError>> + Send + 'a>>
Return the metadata of a file, directory or symbolic link. Read more
§fn have_props<'a>(
&'a self,
path: &'a DavPath,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'a>>
fn have_props<'a>( &'a self, path: &'a DavPath, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'a>>
Indicator that tells if this filesystem driver supports DAV properties. Read more
§fn patch_props<'a>(
&'a self,
path: &'a DavPath,
patch: Vec<(bool, DavProp)>,
) -> Pin<Box<dyn Future<Output = Result<Vec<(StatusCode, DavProp)>, FsError>> + Send + 'a>>
fn patch_props<'a>( &'a self, path: &'a DavPath, patch: Vec<(bool, DavProp)>, ) -> Pin<Box<dyn Future<Output = Result<Vec<(StatusCode, DavProp)>, FsError>> + Send + 'a>>
Patch the DAV properties of a node (add/remove props) Read more
§fn get_props<'a>(
&'a self,
path: &'a DavPath,
do_content: bool,
) -> Pin<Box<dyn Future<Output = Result<Vec<DavProp>, FsError>> + Send + 'a>>
fn get_props<'a>( &'a self, path: &'a DavPath, do_content: bool, ) -> Pin<Box<dyn Future<Output = Result<Vec<DavProp>, FsError>> + Send + 'a>>
List/get the DAV properties of a node. Read more
Auto Trait Implementations§
impl Freeze for OpendalFs
impl !RefUnwindSafe for OpendalFs
impl Send for OpendalFs
impl Sync for OpendalFs
impl Unpin for OpendalFs
impl !UnwindSafe for OpendalFs
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more