Struct dodo::Directory[][src]

pub struct Directory { /* fields omitted */ }

Storage backed by a folder.

Locking strategy

This storage does not have any entry locking mechanism.

Errors

All files in the folder are considered part of this storage. Thus, any unexpected event (denied permission, interrupted, …) in the folder will result in an error.

It is expected that the folder remains valid as long a the storage exists. Tempering with the folder in any way (deleting it, moving it, removing permissions, …) will result in an error.

Implementations

impl Directory[src]

pub fn new<P>(path: P) -> Result<Self> where
    P: AsRef<Path>, 
[src]

Create a new directory storage, or open it if it already exist. Folders are created recursively if needed.

Examples

use dodo::prelude::*;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let directory = Directory::new(&path)?;
    Ok(())
}

Errors

This will return an error in the following situations :

  • Folders didn’t exists, and storage wasn’t able to create it.
  • Path points at a file, not a folder.
  • Other IO specific errors (permission denied, invalid path, …).

Trait Implementations

impl Clone for Directory[src]

impl Debug for Directory[src]

impl Storage for Directory[src]

type Read = FileReader

Reader.

type Write = FileWriter

Writer.

type Iterator = Iter

Iterator.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,