pub struct MapxVs<K, V> { /* private fields */ }Expand description
Documents => MapxRawVs
Implementations
sourceimpl<K, V> MapxVs<K, V> where
K: KeyEnDe,
V: ValueEnDe,
impl<K, V> MapxVs<K, V> where
K: KeyEnDe,
V: ValueEnDe,
pub fn new() -> Self
pub fn get(&self, key: &K) -> Option<V>
pub fn get_mut<'a>(&'a self, key: &'a K) -> Option<ValueMut<'a, K, V>>
pub fn entry_ref<'a>(&'a self, key: &'a K) -> Entry<'a, K, V>
pub fn get_le(&self, key: &K) -> Option<(K, V)>
pub fn get_ge(&self, key: &K) -> Option<(K, V)>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn insert(&self, key: K, value: V) -> Result<Option<V>>
pub fn insert_ref(&self, key: &K, value: &V) -> Result<Option<V>>
pub fn iter(&self) -> MapxVsIter<'_, K, V>ⓘNotable traits for MapxVsIter<'a, K, V>impl<'a, K, V> Iterator for MapxVsIter<'a, K, V> where
K: KeyEnDe,
V: ValueEnDe, type Item = (K, V);
K: KeyEnDe,
V: ValueEnDe, type Item = (K, V);
pub fn range<'a, R: 'a + RangeBounds<K>>(
&'a self,
bounds: R
) -> MapxVsIter<'a, K, V>ⓘNotable traits for MapxVsIter<'a, K, V>impl<'a, K, V> Iterator for MapxVsIter<'a, K, V> where
K: KeyEnDe,
V: ValueEnDe, type Item = (K, V);
K: KeyEnDe,
V: ValueEnDe, type Item = (K, V);
pub fn first(&self) -> Option<(K, V)>
pub fn last(&self) -> Option<(K, V)>
pub fn contains_key(&self, key: &K) -> bool
pub fn remove(&self, key: &K) -> Result<Option<V>>
pub fn clear(&mut self)
pub fn get_by_branch(&self, key: &K, branch_name: BranchName<'_>) -> Option<V>
pub fn get_le_by_branch(
&self,
key: &K,
branch_name: BranchName<'_>
) -> Option<(K, V)>
pub fn get_ge_by_branch(
&self,
key: &K,
branch_name: BranchName<'_>
) -> Option<(K, V)>
pub fn len_by_branch(&self, branch_name: BranchName<'_>) -> usize
pub fn is_empty_by_branch(&self, branch_name: BranchName<'_>) -> bool
pub fn insert_by_branch(
&self,
key: K,
value: V,
branch_name: BranchName<'_>
) -> Result<Option<V>>
pub fn insert_ref_by_branch(
&self,
key: &K,
value: &V,
branch_name: BranchName<'_>
) -> Result<Option<V>>
pub fn iter_by_branch(
&self,
branch_name: BranchName<'_>
) -> MapxVsIter<'_, K, V>ⓘNotable traits for MapxVsIter<'a, K, V>impl<'a, K, V> Iterator for MapxVsIter<'a, K, V> where
K: KeyEnDe,
V: ValueEnDe, type Item = (K, V);
K: KeyEnDe,
V: ValueEnDe, type Item = (K, V);
pub fn range_by_branch<'a, R: 'a + RangeBounds<K>>(
&'a self,
bounds: R,
branch_name: BranchName<'_>
) -> MapxVsIter<'a, K, V>ⓘNotable traits for MapxVsIter<'a, K, V>impl<'a, K, V> Iterator for MapxVsIter<'a, K, V> where
K: KeyEnDe,
V: ValueEnDe, type Item = (K, V);
K: KeyEnDe,
V: ValueEnDe, type Item = (K, V);
pub fn first_by_branch(&self, branch_name: BranchName<'_>) -> Option<(K, V)>
pub fn last_by_branch(&self, branch_name: BranchName<'_>) -> Option<(K, V)>
pub fn contains_key_by_branch(
&self,
key: &K,
branch_name: BranchName<'_>
) -> bool
pub fn remove_by_branch(
&self,
key: &K,
branch_name: BranchName<'_>
) -> Result<Option<V>>
pub fn get_by_branch_version(
&self,
key: &K,
branch_name: BranchName<'_>,
version_name: VersionName<'_>
) -> Option<V>
pub fn get_le_by_branch_version(
&self,
key: &K,
branch_name: BranchName<'_>,
version_name: VersionName<'_>
) -> Option<(K, V)>
pub fn get_ge_by_branch_version(
&self,
key: &K,
branch_name: BranchName<'_>,
version_name: VersionName<'_>
) -> Option<(K, V)>
pub fn len_by_branch_version(
&self,
branch_name: BranchName<'_>,
version_name: VersionName<'_>
) -> usize
pub fn is_empty_by_branch_version(
&self,
branch_name: BranchName<'_>,
version_name: VersionName<'_>
) -> bool
pub fn iter_by_branch_version(
&self,
branch_name: BranchName<'_>,
version_name: VersionName<'_>
) -> MapxVsIter<'_, K, V>ⓘNotable traits for MapxVsIter<'a, K, V>impl<'a, K, V> Iterator for MapxVsIter<'a, K, V> where
K: KeyEnDe,
V: ValueEnDe, type Item = (K, V);
K: KeyEnDe,
V: ValueEnDe, type Item = (K, V);
pub fn range_by_branch_version<'a, R: 'a + RangeBounds<K>>(
&'a self,
bounds: R,
branch_name: BranchName<'_>,
version_name: VersionName<'_>
) -> MapxVsIter<'a, K, V>ⓘNotable traits for MapxVsIter<'a, K, V>impl<'a, K, V> Iterator for MapxVsIter<'a, K, V> where
K: KeyEnDe,
V: ValueEnDe, type Item = (K, V);
K: KeyEnDe,
V: ValueEnDe, type Item = (K, V);
pub fn first_by_branch_version(
&self,
branch_name: BranchName<'_>,
version_name: VersionName<'_>
) -> Option<(K, V)>
pub fn last_by_branch_version(
&self,
branch_name: BranchName<'_>,
version_name: VersionName<'_>
) -> Option<(K, V)>
pub fn contains_key_by_branch_version(
&self,
key: &K,
branch_name: BranchName<'_>,
version_name: VersionName<'_>
) -> bool
Trait Implementations
sourceimpl<'de, K, V> Deserialize<'de> for MapxVs<K, V>
impl<'de, K, V> Deserialize<'de> for MapxVs<K, V>
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<K, V> VsMgmt for MapxVs<K, V> where
K: KeyEnDe,
V: ValueEnDe,
impl<K, V> VsMgmt for MapxVs<K, V> where
K: KeyEnDe,
V: ValueEnDe,
sourcefn version_create(&self, version_name: VersionName<'_>) -> Result<()>
fn version_create(&self, version_name: VersionName<'_>) -> Result<()>
Create a new version on the default branch.
sourcefn version_create_by_branch(
&self,
version_name: VersionName<'_>,
branch_name: BranchName<'_>
) -> Result<()>
fn version_create_by_branch(
&self,
version_name: VersionName<'_>,
branch_name: BranchName<'_>
) -> Result<()>
Create a new version on a specified branch, NOTE: the branch must has been created.
sourcefn version_exists(&self, version_name: VersionName<'_>) -> bool
fn version_exists(&self, version_name: VersionName<'_>) -> bool
Check if a verison exists on default branch.
sourcefn version_exists_on_branch(
&self,
version_name: VersionName<'_>,
branch_name: BranchName<'_>
) -> bool
fn version_exists_on_branch(
&self,
version_name: VersionName<'_>,
branch_name: BranchName<'_>
) -> bool
Check if a version exists on a specified branch(include its parents).
sourcefn version_pop(&self) -> Result<()>
fn version_pop(&self) -> Result<()>
Remove the newest version on the default branch.
‘Write’-like operations on branches and versions are different from operations on data.
‘Write’-like operations on data require recursive tracing of all parent nodes, while operations on branches and versions are limited to their own perspective, and should not do any tracing.
sourcefn version_pop_by_branch(&self, branch_name: BranchName<'_>) -> Result<()>
fn version_pop_by_branch(&self, branch_name: BranchName<'_>) -> Result<()>
Remove the newest version on a specified branch.
‘Write’-like operations on branches and versions are different from operations on data.
‘Write’-like operations on data require recursive tracing of all parent nodes, while operations on branches and versions are limited to their own perspective, and should not do any tracing.
sourceunsafe fn version_rebase(&self, base_version: VersionName<'_>) -> Result<()>
unsafe fn version_rebase(&self, base_version: VersionName<'_>) -> Result<()>
Merge all changes made by new versions after the base version into the base version.
Safety
It’s the caller’s duty to ensure that
the base_version was created directly by the branch_id,
or the data records of other branches may be corrupted.
sourceunsafe fn version_rebase_by_branch(
&self,
base_version: VersionName<'_>,
branch_name: BranchName<'_>
) -> Result<()>
unsafe fn version_rebase_by_branch(
&self,
base_version: VersionName<'_>,
branch_name: BranchName<'_>
) -> Result<()>
Merge all changes made by new versions after the base version into the base version.
Safety
It’s the caller’s duty to ensure that
the base_version was created directly by the branch_id,
or the data records of other branches may be corrupted.
sourcefn branch_create(
&self,
branch_name: BranchName<'_>,
version_name: VersionName<'_>,
force: bool
) -> Result<()>
fn branch_create(
&self,
branch_name: BranchName<'_>,
version_name: VersionName<'_>,
force: bool
) -> Result<()>
Create a new branch based on the head of the default branch.
sourcefn branch_create_by_base_branch(
&self,
branch_name: BranchName<'_>,
version_name: VersionName<'_>,
base_branch_name: ParentBranchName<'_>,
force: bool
) -> Result<()>
fn branch_create_by_base_branch(
&self,
branch_name: BranchName<'_>,
version_name: VersionName<'_>,
base_branch_name: ParentBranchName<'_>,
force: bool
) -> Result<()>
Create a new branch based on the head of a specified branch.
sourcefn branch_create_by_base_branch_version(
&self,
branch_name: BranchName<'_>,
version_name: VersionName<'_>,
base_branch_name: ParentBranchName<'_>,
base_version_name: VersionName<'_>,
force: bool
) -> Result<()>
fn branch_create_by_base_branch_version(
&self,
branch_name: BranchName<'_>,
version_name: VersionName<'_>,
base_branch_name: ParentBranchName<'_>,
base_version_name: VersionName<'_>,
force: bool
) -> Result<()>
Create a new branch based on a specified version of a specified branch.
sourceunsafe fn branch_create_without_new_version(
&self,
branch_name: BranchName<'_>,
force: bool
) -> Result<()>
unsafe fn branch_create_without_new_version(
&self,
branch_name: BranchName<'_>,
force: bool
) -> Result<()>
Safety
You should create a new version manually before writing to the new branch, or the data records referenced by other branches may be corrupted.
sourceunsafe fn branch_create_by_base_branch_without_new_version(
&self,
branch_name: BranchName<'_>,
base_branch_name: ParentBranchName<'_>,
force: bool
) -> Result<()>
unsafe fn branch_create_by_base_branch_without_new_version(
&self,
branch_name: BranchName<'_>,
base_branch_name: ParentBranchName<'_>,
force: bool
) -> Result<()>
Safety
You should create a new version manually before writing to the new branch, or the data records referenced by other branches may be corrupted.
sourceunsafe fn branch_create_by_base_branch_version_without_new_version(
&self,
branch_name: BranchName<'_>,
base_branch_name: ParentBranchName<'_>,
base_version_name: VersionName<'_>,
force: bool
) -> Result<()>
unsafe fn branch_create_by_base_branch_version_without_new_version(
&self,
branch_name: BranchName<'_>,
base_branch_name: ParentBranchName<'_>,
base_version_name: VersionName<'_>,
force: bool
) -> Result<()>
Safety
You should create a new version manually before writing to the new branch, or the data records referenced by other branches may be corrupted.
sourcefn branch_exists(&self, branch_name: BranchName<'_>) -> bool
fn branch_exists(&self, branch_name: BranchName<'_>) -> bool
Check if a branch exists or not.
sourcefn branch_has_versions(&self, branch_name: BranchName<'_>) -> bool
fn branch_has_versions(&self, branch_name: BranchName<'_>) -> bool
Check if a branch exists and has versions on it.
sourcefn branch_remove(&self, branch_name: BranchName<'_>) -> Result<()>
fn branch_remove(&self, branch_name: BranchName<'_>) -> Result<()>
Remove a branch, remove all changes directly made by this branch.
‘Write’-like operations on branches and versions are different from operations on data.
‘Write’-like operations on data require recursive tracing of all parent nodes, while operations on branches and versions are limited to their own perspective, and should not do any tracing.
sourcefn branch_truncate(&self, branch_name: BranchName<'_>) -> Result<()>
fn branch_truncate(&self, branch_name: BranchName<'_>) -> Result<()>
Remove all changes directly made by versions(bigger than last_version_id) of this branch.
‘Write’-like operations on branches and versions are different from operations on data.
‘Write’-like operations on data require recursive tracing of all parent nodes, while operations on branches and versions are limited to their own perspective, and should not do any tracing.
sourcefn branch_truncate_to(
&self,
branch_name: BranchName<'_>,
last_version_name: VersionName<'_>
) -> Result<()>
fn branch_truncate_to(
&self,
branch_name: BranchName<'_>,
last_version_name: VersionName<'_>
) -> Result<()>
Remove all changes directly made by versions(bigger than last_version_id) of this branch.
‘Write’-like operations on branches and versions are different from operations on data.
‘Write’-like operations on data require recursive tracing of all parent nodes, while operations on branches and versions are limited to their own perspective, and should not do any tracing.
sourcefn branch_pop_version(&self, branch_name: BranchName<'_>) -> Result<()>
fn branch_pop_version(&self, branch_name: BranchName<'_>) -> Result<()>
Remove the newest version on a specified branch.
‘Write’-like operations on branches and versions are different from operations on data.
‘Write’-like operations on data require recursive tracing of all parent nodes, while operations on branches and versions are limited to their own perspective, and should not do any tracing.
sourcefn branch_merge_to(
&self,
branch_name: BranchName<'_>,
target_branch_name: BranchName<'_>
) -> Result<()>
fn branch_merge_to(
&self,
branch_name: BranchName<'_>,
target_branch_name: BranchName<'_>
) -> Result<()>
Merge a branch into another
sourceunsafe fn branch_merge_to_force(
&self,
branch_name: BranchName<'_>,
target_branch_name: BranchName<'_>
) -> Result<()>
unsafe fn branch_merge_to_force(
&self,
branch_name: BranchName<'_>,
target_branch_name: BranchName<'_>
) -> Result<()>
Merge a branch into another, even if new different versions have been created on the target branch.
Safety
If new different versions have been created on the target branch, the data records referenced by other branches may be corrupted.
sourcefn branch_set_default(&mut self, branch_name: BranchName<'_>) -> Result<()>
fn branch_set_default(&mut self, branch_name: BranchName<'_>) -> Result<()>
Make a branch to be default, all default operations will be applied to it.
sourcefn prune(&self, reserved_ver_num: Option<usize>) -> Result<()>
fn prune(&self, reserved_ver_num: Option<usize>) -> Result<()>
Clean outdated versions out of the default reserved number.
fn version_exists_globally(&self, version_name: VersionName<'_>) -> bool
sourcefn version_list(&self) -> Result<Vec<VersionNameOwned>>
fn version_list(&self) -> Result<Vec<VersionNameOwned>>
NOTE Read more
sourcefn version_list_by_branch(
&self,
branch_name: BranchName<'_>
) -> Result<Vec<VersionNameOwned>>
fn version_list_by_branch(
&self,
branch_name: BranchName<'_>
) -> Result<Vec<VersionNameOwned>>
NOTE Read more
sourcefn version_list_globally(&self) -> Vec<VersionNameOwned>
fn version_list_globally(&self) -> Vec<VersionNameOwned>
NOTE Read more
fn version_has_change_set(&self, version_name: VersionName<'_>) -> Result<bool>
fn version_clean_up_globally(&self) -> Result<()>
sourceunsafe fn version_revert_globally(
&self,
version_name: VersionName<'_>
) -> Result<()>
unsafe fn version_revert_globally(
&self,
version_name: VersionName<'_>
) -> Result<()>
Safety Read more
fn branch_is_empty(&self, branch_name: BranchName<'_>) -> Result<bool>
sourcefn branch_list(&self) -> Vec<BranchNameOwned>
fn branch_list(&self) -> Vec<BranchNameOwned>
NOTE Read more
fn branch_get_default(&self) -> BranchNameOwned
sourceunsafe fn branch_swap(
&mut self,
branch_1: BranchName<'_>,
branch_2: BranchName<'_>
) -> Result<()>
unsafe fn branch_swap(
&mut self,
branch_1: BranchName<'_>,
branch_2: BranchName<'_>
) -> Result<()>
Logically similar to std::ptr::swap Read more
impl<K: Eq, V: Eq> Eq for MapxVs<K, V>
impl<K, V> StructuralEq for MapxVs<K, V>
impl<K, V> StructuralPartialEq for MapxVs<K, V>
Auto Trait Implementations
impl<K, V> RefUnwindSafe for MapxVs<K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for MapxVs<K, V> where
K: Send,
V: Send,
impl<K, V> Sync for MapxVs<K, V> where
K: Sync,
V: Sync,
impl<K, V> Unpin for MapxVs<K, V> where
K: Unpin,
V: Unpin,
impl<K, V> UnwindSafe for MapxVs<K, V> where
K: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more