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>
impl<K, V> Change for Loaded<K, V>
Source§fn insert_owned(
&self,
key: K,
value: V,
) -> Result<Option<<Self as Change>::Value>>
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>>
fn remove_ref( &self, key: &<Self as Change>::Key, ) -> Result<Option<<Self as Change>::Value>>
Removes a key reference.
Source§fn fetch_and_update(
&self,
key: &Self::Key,
f: impl FnMut(Option<Self::Value>) -> Option<Self::Value>,
) -> Result<Option<Self::Value>>
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>>
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>>
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>>
fn entry_ref<'a>( &'a self, key: &'a <Self as Change>::Key, ) -> Result<Entry<'a, Self>>
Gets an Entry from a key reference.
Source§fn entry<K: Into<<Self as Change>::Key>>(
&self,
key: K,
) -> Result<Entry<'_, Self>>
fn entry<K: Into<<Self as Change>::Key>>( &self, key: K, ) -> Result<Entry<'_, Self>>
Gets an Entry from a key.
Source§fn push_owned(&self, value: <Self as Change>::Insert) -> Result<()>
fn push_owned(&self, value: <Self as Change>::Insert) -> Result<()>
Pushes a value onto the end of the tree.
Source§impl<K, V> View for Loaded<K, V>
impl<K, V> View for Loaded<K, V>
Source§type Iter = Box<dyn Iterator<Item = Result<(K, V), Error>>>
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>>
fn get_ref(&self, key: &Self::Key) -> Result<Option<Self::Value>>
Gets a value from a key by reference.
Source§fn contains_key_ref(&self, key: &Self::Key) -> Result<bool>
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)>>
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)>>
fn get_gt_ref( &self, key: &Self::Key, ) -> Result<Option<(Self::Key, Self::Value)>>
Gets the immediate greater item by key reference.
Source§fn range(&self, range: impl RangeBounds<Self::Key>) -> Result<Self::Iter>
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>>
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>
fn contains_key<K: Into<Self::Key>>(&self, key: K) -> Result<bool>
Checks if tree contains a 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>
impl<K, V> Sync for Loaded<K, V>
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> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.