Skip to main content

MemStore

Struct MemStore 

Source
pub struct MemStore { /* private fields */ }

Implementations§

Source§

impl MemStore

Source

pub fn open( path: impl AsRef<Path>, log_limit_bytes: usize, subscriber_queue: usize, ) -> Result<Arc<MemStore>, Error>

Source

pub fn open_with( path: impl AsRef<Path>, log_limit_bytes: usize, subscriber_queue: usize, mode: SyncMode, ) -> Result<Arc<MemStore>, Error>

Source§

impl MemStore

Source

pub fn new(log_limit_bytes: usize, subscriber_queue: usize) -> Arc<MemStore> ⓘ

Source

pub fn rev(&self) -> u64

Source

pub fn get(&self, key: &str) -> Option<Bytes>

Source

pub fn list(&self, prefix: &str) -> Snapshot

Source

pub fn put(&self, key: &str, build: impl FnOnce(u64) -> Bytes) -> u64

Source

pub fn delete( &self, key: &str, build: impl FnOnce(u64, &Bytes) -> Bytes, ) -> Option<u64>

Source

pub fn put_checked<E>( &self, key: &str, build: impl FnOnce(Option<&Bytes>, u64) -> Result<Bytes, E>, ) -> Result<(u64, Bytes), E>

Source

pub fn delete_checked<E>( &self, key: &str, build: impl FnOnce(&Bytes, u64) -> Result<Bytes, E>, ) -> Result<Option<(u64, Bytes)>, E>

Source

pub fn watch( &self, prefix: &str, since: Option<u64>, ) -> Result<Watch, WatchError>

Source

pub fn log_bytes(&self) -> usize

Auto Trait Implementations§

§

impl !Freeze for MemStore

§

impl !RefUnwindSafe for MemStore

§

impl !UnwindSafe for MemStore

§

impl Forget for MemStore

§

impl Move for MemStore

§

impl Send for MemStore

§

impl Sync for MemStore

§

impl Unpin for MemStore
where Align4<u32>: Unpin, Align1<u8>: Unpin, *const LeafNode<Arc<str>, Bytes> is !null: Unpin, Box<(Arc<str>, Bytes)>: Unpin, *const u8 is !null: Unpin, Arc<str>: Unpin, *const u8: Unpin, Align8<*mut ()>: Unpin, &'static Vtable: Unpin, Arc<Shared<Event>>: Unpin, Arc<Database>: Unpin, Arc<Atomic<bool>>: Unpin, *mut Counter<Channel<()>>: Unpin, *mut Counter<Channel<()>>: Unpin, *mut Counter<Channel<()>>: Unpin, Arc<Inner, System>: Unpin, Arc<Packet<'static, ()>>: Unpin,

§

impl UnsafeUnpin for MemStore
where Align4<u32>: UnsafeUnpin, Align1<u8>: UnsafeUnpin, *const LeafNode<Arc<str>, Bytes> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(Arc<str>, Bytes)>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<Event>: UnsafeUnpin, *const ArcInner<Shared<Event>> is !null: UnsafeUnpin, PhantomData<ArcInner<Shared<Event>>>: UnsafeUnpin, *const ArcInner<Database> is !null: UnsafeUnpin, PhantomData<ArcInner<Database>>: UnsafeUnpin, *const ArcInner<Atomic<bool>> is !null: UnsafeUnpin, PhantomData<ArcInner<Atomic<bool>>>: UnsafeUnpin, *mut Counter<Channel<()>>: UnsafeUnpin, *mut Counter<Channel<()>>: UnsafeUnpin, *mut Counter<Channel<()>>: UnsafeUnpin, *const ArcInner<Inner> is !null: UnsafeUnpin, PhantomData<ArcInner<Inner>>: UnsafeUnpin, *const ArcInner<Packet<'static, ()>> is !null: UnsafeUnpin, PhantomData<ArcInner<Packet<'static, ()>>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more