pub struct FileTokenStore { /* private fields */ }Available on non-
target_family=wasm only.Expand description
A TokenStore keeping each record in <dir>/<key>.json, written whole
or not at all (a temporary file renamed over it), and held across
processes with a file lock on <dir>/<key>.lock. On Unix the files, and
the directories it creates for them, are readable by the owner alone.
Native only.
Implementations§
Trait Implementations§
Source§impl Clone for FileTokenStore
impl Clone for FileTokenStore
Source§impl Debug for FileTokenStore
impl Debug for FileTokenStore
Source§impl TokenStore for FileTokenStore
impl TokenStore for FileTokenStore
Source§fn lock<'a>(
&'a self,
key: &'a str,
) -> WasmBoxedFuture<'a, Result<StoreLock, BoxError>>
fn lock<'a>( &'a self, key: &'a str, ) -> WasmBoxedFuture<'a, Result<StoreLock, BoxError>>
Takes the file lock on <dir>/<key>.lock, waiting while another
holder has it, for at most two minutes. A process that dies lets go
of it.
Source§fn load<'a>(
&'a self,
key: &'a str,
) -> WasmBoxedFuture<'a, Result<Option<String>, BoxError>>
fn load<'a>( &'a self, key: &'a str, ) -> WasmBoxedFuture<'a, Result<Option<String>, BoxError>>
The record kept under
key, or None when there is none. An error
means the store could not answer, and fails the request.Auto Trait Implementations§
impl Freeze for FileTokenStore
impl RefUnwindSafe for FileTokenStore
impl Send for FileTokenStore
impl Sync for FileTokenStore
impl Unpin for FileTokenStore
impl UnsafeUnpin for FileTokenStore
impl UnwindSafe for FileTokenStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
Converts
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> ⓘ
Converts
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