pub struct PathCacher<Q: PathQuery> { /* private fields */ }Available on crate feature
internal-path-cache only.Expand description
PathCacher is a cache for path query.
OpenDAL is designed for path based storage systems, such as S3, HDFS, etc. But there are many services that are not path based, such as OneDrive, Google Drive, etc. For these services, we look up files based on id. The lookup of id is very expensive, so we cache the path to id mapping in PathCacher.
§Behavior
The path in the cache is always an absolute one. For example, if the service root is /root/,
then the path of file a/b in cache will be /root/a/b.
Implementations§
Source§impl<Q: PathQuery> PathCacher<Q>
impl<Q: PathQuery> PathCacher<Q>
Sourcepub async fn ensure_dir(&self, path: &str) -> Result<String>
pub async fn ensure_dir(&self, path: &str) -> Result<String>
Ensure input dir exists.
Auto Trait Implementations§
impl<Q> !Freeze for PathCacher<Q>
impl<Q> !RefUnwindSafe for PathCacher<Q>
impl<Q> Send for PathCacher<Q>where
Q: Send,
impl<Q> Sync for PathCacher<Q>where
Q: Sync,
impl<Q> Unpin for PathCacher<Q>where
Q: Unpin,
impl<Q> !UnwindSafe for PathCacher<Q>
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