pub struct FileTokenStore { /* private fields */ }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 on Unix the
directory synced after), 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.
load refuses a record that is a symlink or not a
regular file, or is over 64 KiB, with a FileStoreError. On Unix, when
group or others have any access to a record, it narrows the record to
owner-only before reading it, and refuses the record when that fails.
Implementations§
Source§impl FileTokenStore
impl FileTokenStore
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 unless
with_lock_wait set another wait,
then refusing with FileStoreError::Busy. 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>>
key, or None when there is none. An error
means the store could not answer, and fails the request.Auto Trait Implementations§
impl Forget for FileTokenStore
impl Freeze for FileTokenStore
impl Move 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
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> ⓘ
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