pub struct VdirStorage<I: Item> {
pub path: Utf8PathBuf,
pub extension: String,
/* private fields */
}Expand description
A vdir filesystem directory containing zero or more directories.
Each child directory is treated as Collection. Nested subdirectories are not supported.
§Hrefs
Internally, all hrefs are paths relative to the base directory.
Fields§
§path: Utf8PathBufThe path to a directory containing a storage.
Each top-level subdirectory will be treated as a separate collection, and individual files
inside these are each treated as an Item.
extension: StringFilename extension for items in a storage. Files with matching extension are treated a items for a collection, and all other files are ignored.
Implementations§
Source§impl<I: Item> VdirStorage<I>
impl<I: Item> VdirStorage<I>
pub fn new(path: Utf8PathBuf, extension: String) -> Self
Trait Implementations§
Source§impl<I: Item> Storage<I> for VdirStorage<I>where
I::Property: PropertyWithFilename,
impl<I: Item> Storage<I> for VdirStorage<I>where
I::Property: PropertyWithFilename,
Source§fn delete_item<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
href: &'life1 str,
etag: &'life2 Etag,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_item<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
href: &'life1 str,
etag: &'life2 Etag,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
§Quirks
Checking the etag is vulnerable to TOCTOU race conditions. Filesystem APIs do not provide facilities to work around this.
Source§fn monitor<'life0, 'async_trait>(
&'life0 self,
interval: Duration,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn StorageMonitor>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn monitor<'life0, 'async_trait>(
&'life0 self,
interval: Duration,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn StorageMonitor>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Monitor the storage for changes.
Due to limitations of the inotify subsystem, it is possible that some events are silently
lost. To compensate for these, the monitor shall yield a Event::General every
interval.
Source§fn check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn discover_collections<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Discovery, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn discover_collections<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Discovery, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn create_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
href: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Collection, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_collection<'life0, 'life1, 'async_trait>(
&'life0 self,
href: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Collection, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
href.