Skip to main content

Loaded

Struct Loaded 

Source
pub struct Loaded<K, V> { /* private fields */ }
Expand description

A tree loaded in memory.

Trait Implementations§

Source§

impl<K, V> Change for Loaded<K, V>
where K: 'static + Clone + Send + Sync + Ord, V: 'static + Clone + Send + Sync,

Source§

type Key = K

The type of key that is used on inserts and removals.
Source§

type Value = V

The type of value expected on removal.
Source§

type Insert = V

The type of value expected on inserts.
Source§

fn insert_owned( &self, key: K, value: V, ) -> Result<Option<<Self as Change>::Value>>

Inserts an owned key-value pair into the tree.
Source§

fn remove_ref( &self, key: &<Self as Change>::Key, ) -> Result<Option<<Self as Change>::Value>>

Removes a key reference.
Source§

fn clear(&self) -> Result<()>

Clears the tree.
Source§

fn fetch_and_update( &self, key: &Self::Key, f: impl FnMut(Option<Self::Value>) -> Option<Self::Value>, ) -> Result<Option<Self::Value>>

Updates an entry atomically
Source§

fn insert_ref( &self, key: &Self::Key, value: &Self::Insert, ) -> Result<Option<<Self as Change>::Value>>

Inserts a reference key-value pair into the tree.
Source§

fn insert<IK: Into<Self::Key>, IV: Into<Self::Insert>>( &self, key: IK, value: IV, ) -> Result<Option<<Self as Change>::Value>>

Inserts a key-value pair into the tree.
Source§

fn entry_ref<'a>( &'a self, key: &'a <Self as Change>::Key, ) -> Result<Entry<'a, Self>>
where Self: View + Change<Key = <Self as View>::Key, Value = <Self as View>::Value, Insert = <Self as View>::Value>,

Gets an Entry from a key reference.
Source§

fn entry<K: Into<<Self as Change>::Key>>( &self, key: K, ) -> Result<Entry<'_, Self>>
where Self: View + Change<Key = <Self as View>::Key, Value = <Self as View>::Value, Insert = <Self as View>::Value>,

Gets an Entry from a key.
Source§

fn push_owned(&self, value: <Self as Change>::Insert) -> Result<()>
where Self: View<Key = <Self as Change>::Key>, <Self as View>::Key: AutoInc + Ord,

Pushes a value onto the end of the tree.
Source§

fn push<V>(&self, value: V) -> Result<()>
where Self: View<Key = <Self as Change>::Key>, <Self as View>::Key: AutoInc + Ord, V: Into<<Self as Change>::Insert>,

Pushes a value onto the end of the tree.
Source§

fn remove_owned( &self, key: <Self as Change>::Key, ) -> Result<Option<<Self as Change>::Value>>

Removes an owned key.
Source§

fn remove<K: Into<Self::Key>>( &self, key: K, ) -> Result<Option<<Self as Change>::Value>>

Removes a key.
Source§

impl<K, V> Clone for Loaded<K, V>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<K, V> View for Loaded<K, V>
where K: 'static + Clone + Send + Sync + Ord, V: 'static + Clone + Send + Sync,

Source§

type Key = K

The key used on fetch.
Source§

type Value = V

The value expected on fetch.
Source§

type Iter = Box<dyn Iterator<Item = Result<(K, V), Error>>>

The type of iterator returned by iter.
Source§

fn get_ref(&self, key: &Self::Key) -> Result<Option<Self::Value>>

Gets a value from a key by reference.
Source§

fn iter(&self) -> Self::Iter

Gets an iterator over the entries in the tree.
Source§

fn contains_key_ref(&self, key: &Self::Key) -> Result<bool>

Checks if tree contains a key by reference.
Source§

fn get_lt_ref( &self, key: &Self::Key, ) -> Result<Option<(Self::Key, Self::Value)>>

Gets the immediate lesser item by key reference.
Source§

fn get_gt_ref( &self, key: &Self::Key, ) -> Result<Option<(Self::Key, Self::Value)>>

Gets the immediate greater item by key reference.
Source§

fn first(&self) -> Result<Option<(Self::Key, Self::Value)>>

Gets the first item.
Source§

fn last(&self) -> Result<Option<(Self::Key, Self::Value)>>

Gets the last item.
Source§

fn is_empty(&self) -> Option<bool>

Checks if tree is empty
Source§

fn range(&self, range: impl RangeBounds<Self::Key>) -> Result<Self::Iter>

Gets an iterator over a key range in the tree
Source§

fn get<K: Into<Self::Key>>(&self, key: K) -> Result<Option<Self::Value>>

Gets a value from a key.
Source§

fn contains_key<K: Into<Self::Key>>(&self, key: K) -> Result<bool>

Checks if tree contains a key.
Source§

fn get_lt<K: Into<Self::Key>>( &self, key: K, ) -> Result<Option<(Self::Key, Self::Value)>>
where Self::Key: Ord,

Gets the immediate lesser item by key.
Source§

fn get_gt<K: Into<Self::Key>>( &self, key: K, ) -> Result<Option<(Self::Key, Self::Value)>>
where Self::Key: Ord,

Gets the immediate greater item by key.

Auto Trait Implementations§

§

impl<K, V> Freeze for Loaded<K, V>

§

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

§

impl<K, V> Send for Loaded<K, V>
where K: Send + Sync, V: Send + Sync,

§

impl<K, V> Sync for Loaded<K, V>
where K: Send + Sync, V: Send + Sync,

§

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

§

impl<K, V> UnsafeUnpin for Loaded<K, V>

§

impl<K, V> !UnwindSafe for Loaded<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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
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> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.