Struct SkipListLayer

Source
pub struct SkipListLayer<K, V> { /* private fields */ }

Implementations§

Source§

impl<K, V> SkipListLayer<K, V>

Source

pub fn new(max_item_count: usize) -> Arc<SkipListLayer<K, V>>

Source

pub fn len(&self) -> usize

Source§

impl<K: Eq + Key + OrdLowerBound, V: LayerValue> SkipListLayer<K, V>

Source

pub fn erase(&self, key: &K)
where K: Eq,

Source

pub fn insert(&self, item: Item<K, V>) -> Result<(), Error>

Inserts the given item.

Source

pub fn replace_or_insert(&self, item: Item<K, V>)

Replaces or inserts the given item.

Source

pub fn merge_into( &self, item: Item<K, V>, lower_bound: &K, merge_fn: MergeFn<K, V>, )

Merges the item into the layer.

Trait Implementations§

Source§

impl<K, V> Drop for SkipListLayer<K, V>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<K: Key, V: LayerValue> Layer<K, V> for SkipListLayer<K, V>

Source§

fn seek<'a, 'life0, 'async_trait>( &'a self, bound: Bound<&'life0 K>, ) -> Pin<Box<dyn Future<Output = Result<BoxedLayerIterator<'a, K, V>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Searches for a key. Bound::Excluded is not supported. Bound::Unbounded positions the iterator on the first item in the layer.
Source§

fn lock(&self) -> Option<Arc<DropEvent>>

Locks the layer preventing it from being closed. This will never block i.e. there can be many locks concurrently. The lock is purely advisory: seek will still work even if lock has not been called; it merely causes close to wait until all locks are released. Returns None if close has been called for the layer.
Source§

fn estimated_len(&self) -> ItemCount

Returns the number of items in the layer file, or an estimate if not known. Old persistent layer formats did not keep track of how many entries they have, hence the estimate. If this is wrong, bloom filter sizing might be off, but that won’t affect correctness, and will wash out with future compactions anyways.
Source§

fn close<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Waits for existing locks readers to finish and then returns. Subsequent calls to lock will return None.
Source§

fn get_version(&self) -> Version

Returns the version number used by structs in this layer
Source§

fn record_inspect_data(self: Arc<Self>, node: &Node)

Records inspect data for the layer into node. Called lazily when inspect is queried.
Source§

fn handle(&self) -> Option<&dyn ReadObjectHandle>

If the layer is persistent, returns the handle to its contents. Returns None for in-memory layers.
Source§

fn purge_cached_data(&self)

Some layer implementations may choose to cache data in-memory. Calling this function will request that the layer purges unused cached data. This is intended to run on a timer.
Source§

fn maybe_contains_key(&self, _key: &K) -> bool

Returns whether the layer might contain records relevant to key. Note that this can return true even if the layer has no records relevant to key, but it will never return false if there are such records. (As such, always returning true is a trivially correct implementation.)

Auto Trait Implementations§

§

impl<K, V> !Freeze for SkipListLayer<K, V>

§

impl<K, V> !RefUnwindSafe for SkipListLayer<K, V>

§

impl<K, V> Send for SkipListLayer<K, V>

§

impl<K, V> Sync for SkipListLayer<K, V>

§

impl<K, V> Unpin for SkipListLayer<K, V>

§

impl<K, V> UnwindSafe for SkipListLayer<K, V>

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, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V