pub struct FileBackendBuilder { /* private fields */ }Expand description
Builder for FileBackend.
Implementations§
Source§impl FileBackendBuilder
impl FileBackendBuilder
Sourcepub fn cache_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn cache_dir(self, dir: impl Into<PathBuf>) -> Self
Set the cache directory (default: <system temp dir>/cachekit, the
same default as cachekit-py).
Sourcepub fn build(self) -> Result<FileBackend, CachekitError>
pub fn build(self) -> Result<FileBackend, CachekitError>
Create the cache directory if needed and construct a FileBackend.
On unix, a pre-existing directory must be owned by the current
user and not group/other-writable — a default like /tmp/cachekit
pre-created by another local user would otherwise let them poison
plaintext cache entries (CWE-377). Does not scan the directory: the
sweep of orphaned temp files runs on the backend’s first set (see the
module docs). The one-time directory setup does its I/O
inline; per-operation I/O runs on the blocking pool.
§Errors
Returns a config error if the directory cannot be created or resolved, is not owned by the current user, or is group/other-writable.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FileBackendBuilder
impl RefUnwindSafe for FileBackendBuilder
impl Send for FileBackendBuilder
impl Sync for FileBackendBuilder
impl Unpin for FileBackendBuilder
impl UnsafeUnpin for FileBackendBuilder
impl UnwindSafe for FileBackendBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more