pub struct LocalKeyspaceHandle { /* private fields */ }Implementations§
Source§impl LocalKeyspaceHandle
impl LocalKeyspaceHandle
pub fn is_encrypted(&self) -> bool
Sourcepub async fn persist(&self) -> Result<(), AppError>
pub async fn persist(&self) -> Result<(), AppError>
Fsync the owning database’s journal — see
KeyspaceHandle::persist.
pub async fn insert<V: Serialize>( &self, key: impl Into<Vec<u8>>, value: &V, ) -> Result<(), AppError>
pub async fn get<V: DeserializeOwned + Send + 'static>( &self, key: impl Into<Vec<u8>>, ) -> Result<Option<V>, AppError>
pub async fn remove(&self, key: impl Into<Vec<u8>>) -> Result<(), AppError>
Sourcepub async fn take_raw(
&self,
key: impl Into<Vec<u8>>,
) -> Result<Option<Vec<u8>>, AppError>
pub async fn take_raw( &self, key: impl Into<Vec<u8>>, ) -> Result<Option<Vec<u8>>, AppError>
Atomically GET + DELETE (the classic Redis GETDEL).
The get and remove run under the per-keyspace write lock
(see [WriteLocks]) so they are atomic with respect to any
other take_raw/swap/insert_if_absent racing on the same
keyspace — exactly one caller observes Some. (fjall alone
does NOT provide this: it serialises individual operations,
not check-then-write sequences across blocking threads.)
Used by the canonical refresh-token claim
(crate::auth::session::take_session_id_by_refresh) to
close the rotation TOCTOU: a leaked refresh token can be
presented exactly once even under concurrent retries.
pub async fn insert_raw( &self, key: impl Into<Vec<u8>>, value: impl Into<Vec<u8>>, ) -> Result<(), AppError>
pub async fn get_raw( &self, key: impl Into<Vec<u8>>, ) -> Result<Option<Vec<u8>>, AppError>
pub async fn prefix_iter_raw( &self, prefix: impl Into<Vec<u8>>, ) -> Result<Vec<RawKvPair>, AppError>
Sourcepub async fn range_from_raw(
&self,
from: impl Into<Vec<u8>>,
) -> Result<Vec<RawKvPair>, AppError>
pub async fn range_from_raw( &self, from: impl Into<Vec<u8>>, ) -> Result<Vec<RawKvPair>, AppError>
See KeyspaceHandle::range_from_raw. fjall’s range seeks to
the lower bound, so this reads only keys >= from.
pub async fn prefix_keys( &self, prefix: impl Into<Vec<u8>>, ) -> Result<Vec<Vec<u8>>, AppError>
pub async fn approximate_len(&self) -> Result<usize, AppError>
pub async fn swap<V: Serialize>( &self, old_key: impl Into<Vec<u8>>, new_key: impl Into<Vec<u8>>, value: &V, ) -> Result<bool, AppError>
Trait Implementations§
Source§impl Clone for LocalKeyspaceHandle
impl Clone for LocalKeyspaceHandle
Source§fn clone(&self) -> LocalKeyspaceHandle
fn clone(&self) -> LocalKeyspaceHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for LocalKeyspaceHandle
impl !UnwindSafe for LocalKeyspaceHandle
impl Freeze for LocalKeyspaceHandle
impl Send for LocalKeyspaceHandle
impl Sync for LocalKeyspaceHandle
impl Unpin for LocalKeyspaceHandle
impl UnsafeUnpin for LocalKeyspaceHandle
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> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<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, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
T.