pub struct OrbitCache { /* private fields */ }Expand description
Fleet-shared binary cache. Cheap to clone.
Implementations§
Source§impl OrbitCache
impl OrbitCache
Sourcepub fn with_prefix(fleet: Arc<Fleet>, prefix: impl Into<Arc<str>>) -> Self
pub fn with_prefix(fleet: Arc<Fleet>, prefix: impl Into<Arc<str>>) -> Self
Build a cache that prepends prefix to every key before it
hits the wire. Prefixes are byte identity, not display labels;
use them for namespaces such as php:apcu: or rust:User:.
pub fn prefix(&self) -> &str
Sourcepub fn put(
&self,
key: &str,
value: &[u8],
ttl: Option<Duration>,
) -> Result<NetId64>
pub fn put( &self, key: &str, value: &[u8], ttl: Option<Duration>, ) -> Result<NetId64>
Store value under key. ttl = None means forever until a
later put/delete shadows it.
Sourcepub fn reset(&self) -> Result<NetId64>
pub fn reset(&self) -> Result<NetId64>
Reset the current cache prefix by publishing a namespace tombstone. Existing frames remain in the ring, but reads treat older matching entries as absent.
Sourcepub fn get(&self, key: &str) -> Option<Vec<u8>>
pub fn get(&self, key: &str) -> Option<Vec<u8>>
Read the current value bytes, if present and unexpired.
Sourcepub fn get_entry(&self, key: &str) -> OrbitCacheRead
pub fn get_entry(&self, key: &str) -> OrbitCacheRead
Read with epoch metadata for adapter-level L1 caches.
Trait Implementations§
Source§impl Clone for OrbitCache
impl Clone for OrbitCache
Source§fn clone(&self) -> OrbitCache
fn clone(&self) -> OrbitCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OrbitCache
impl !RefUnwindSafe for OrbitCache
impl Send for OrbitCache
impl Sync for OrbitCache
impl Unpin for OrbitCache
impl UnsafeUnpin for OrbitCache
impl !UnwindSafe for OrbitCache
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