pub struct MapxRaw { /* private fields */ }Implementations
sourceimpl MapxRaw
impl MapxRaw
sourcepub unsafe fn shadow(&self) -> MapxRaw
pub unsafe fn shadow(&self) -> MapxRaw
Safety
This API breaks the semantic safety guarantees, but it is safe to use in a race-free environment.
pub fn new() -> MapxRaw
pub fn get(&self, key: impl AsRef<[u8]>) -> Option<Vec<u8, Global>>
pub fn get_mut(&mut self, key: impl AsRef<[u8]>) -> Option<ValueMut<'_>>
pub fn contains_key(&self, key: impl AsRef<[u8]>) -> bool
pub fn get_le(&self, key: &[u8]) -> Option<(Vec<u8, Global>, Vec<u8, Global>)>
pub fn get_ge(&self, key: &[u8]) -> Option<(Vec<u8, Global>, Vec<u8, Global>)>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn entry(&'a mut self, key: &'a [u8]) -> Entry<'a>
pub fn iter(&self) -> MapxIter<'_>
pub fn range<'a, R>(&'a self, bounds: R) -> MapxIter<'a>where
R: RangeBounds<Cow<'a, [u8]>>,
pub fn iter_mut(&mut self) -> MapxIterMut<'_>
pub fn range_mut<'a, R>(&'a mut self, bounds: R) -> MapxIterMut<'a>where
R: RangeBounds<Cow<'a, [u8]>>,
pub fn last(&self) -> Option<(Vec<u8, Global>, Vec<u8, Global>)>
pub fn insert(
&mut self,
key: impl AsRef<[u8]>,
value: impl AsRef<[u8]>
) -> Option<Vec<u8, Global>>
pub fn remove(&mut self, key: impl AsRef<[u8]>) -> Option<Vec<u8, Global>>
pub fn clear(&mut self)
Trait Implementations
sourceimpl<'de> Deserialize<'de> for MapxRaw
impl<'de> Deserialize<'de> for MapxRaw
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<MapxRaw, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<MapxRaw, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Serialize for MapxRaw
impl Serialize for MapxRaw
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
sourceimpl VsMgmt for MapxRaw
impl VsMgmt for MapxRaw
sourcefn version_create(
&mut self,
VersionName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
fn version_create(
&mut self,
VersionName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
Create a new version on the default branch.
sourcefn version_create_by_branch(
&mut self,
VersionName<'_>,
__: BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
fn version_create_by_branch(
&mut self,
VersionName<'_>,
__: BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
Create a new version on a specified branch,
NOTE: the branch must has been created. Read more
sourcefn version_exists(&self, VersionName<'_>) -> bool
fn version_exists(&self, VersionName<'_>) -> bool
Check if a verison exists on default branch.
sourcefn version_exists_on_branch(&self, VersionName<'_>, __: BranchName<'_>) -> bool
fn version_exists_on_branch(&self, VersionName<'_>, __: BranchName<'_>) -> bool
Check if a version exists on a specified branch(include its parents).
sourcefn version_pop(&mut self) -> Result<(), Box<dyn RucError + 'static, Global>>
fn version_pop(&mut self) -> Result<(), Box<dyn RucError + 'static, Global>>
Remove the newest version on the default branch. Read more
sourcefn version_pop_by_branch(
&mut self,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
fn version_pop_by_branch(
&mut self,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
Remove the newest version on a specified branch. Read more
sourceunsafe fn version_rebase(
&mut self,
VersionName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
unsafe fn version_rebase(
&mut self,
VersionName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
Merge all changes made by new versions after the base version into the base version. Read more
sourceunsafe fn version_rebase_by_branch(
&mut self,
VersionName<'_>,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
unsafe fn version_rebase_by_branch(
&mut self,
VersionName<'_>,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
Merge all changes made by new versions after the base version into the base version. Read more
sourcefn version_exists_globally(&self, VersionName<'_>) -> bool
fn version_exists_globally(&self, VersionName<'_>) -> bool
Check if a version exists.
sourcefn version_list(
&self
) -> Result<Vec<VersionNameOwned, Global>, Box<dyn RucError + 'static, Global>>
fn version_list(
&self
) -> Result<Vec<VersionNameOwned, Global>, Box<dyn RucError + 'static, Global>>
NOTE Read more
sourcefn version_list_by_branch(
&self,
BranchName<'_>
) -> Result<Vec<VersionNameOwned, Global>, Box<dyn RucError + 'static, Global>>
fn version_list_by_branch(
&self,
BranchName<'_>
) -> Result<Vec<VersionNameOwned, Global>, Box<dyn RucError + 'static, Global>>
NOTE Read more
sourcefn version_list_globally(&self) -> Vec<VersionNameOwned, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn version_list_globally(&self) -> Vec<VersionNameOwned, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
NOTE Read more
sourcefn version_has_change_set(
&self,
VersionName<'_>
) -> Result<bool, Box<dyn RucError + 'static, Global>>
fn version_has_change_set(
&self,
VersionName<'_>
) -> Result<bool, Box<dyn RucError + 'static, Global>>
Check if some changes have been make on the version.
sourcefn version_clean_up_globally(
&mut self
) -> Result<(), Box<dyn RucError + 'static, Global>>
fn version_clean_up_globally(
&mut self
) -> Result<(), Box<dyn RucError + 'static, Global>>
Clean up all orphan versions, versions not belong to any branch.
sourceunsafe fn version_revert_globally(
&mut self,
VersionName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
unsafe fn version_revert_globally(
&mut self,
VersionName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
Safety Read more
sourcefn version_chgset_trie_root(
&self,
Option<BranchName<'_>>,
Option<VersionName<'_>>
) -> Result<Vec<u8, Global>, Box<dyn RucError + 'static, Global>>
fn version_chgset_trie_root(
&self,
Option<BranchName<'_>>,
Option<VersionName<'_>>
) -> Result<Vec<u8, Global>, Box<dyn RucError + 'static, Global>>
Generate a trie root of the changes directly made by the target version,
if no target version specified, the header version of the target branch will be used,
if not target branch specified, then use the default branch. Read more
sourcefn branch_create(
&mut self,
BranchName<'_>,
VersionName<'_>,
bool
) -> Result<(), Box<dyn RucError + 'static, Global>>
fn branch_create(
&mut self,
BranchName<'_>,
VersionName<'_>,
bool
) -> Result<(), Box<dyn RucError + 'static, Global>>
Create a new branch based on the head of the default branch.
sourcefn branch_create_by_base_branch(
&mut self,
BranchName<'_>,
VersionName<'_>,
ParentBranchName<'_>,
bool
) -> Result<(), Box<dyn RucError + 'static, Global>>
fn branch_create_by_base_branch(
&mut self,
BranchName<'_>,
VersionName<'_>,
ParentBranchName<'_>,
bool
) -> Result<(), Box<dyn RucError + 'static, Global>>
Create a new branch based on the head of a specified branch.
sourcefn branch_create_by_base_branch_version(
&mut self,
BranchName<'_>,
VersionName<'_>,
ParentBranchName<'_>,
VersionName<'_>,
bool
) -> Result<(), Box<dyn RucError + 'static, Global>>
fn branch_create_by_base_branch_version(
&mut self,
BranchName<'_>,
VersionName<'_>,
ParentBranchName<'_>,
VersionName<'_>,
bool
) -> Result<(), Box<dyn RucError + 'static, Global>>
Create a new branch based on a specified version of a specified branch.
sourceunsafe fn branch_create_without_new_version(
&mut self,
BranchName<'_>,
bool
) -> Result<(), Box<dyn RucError + 'static, Global>>
unsafe fn branch_create_without_new_version(
&mut self,
BranchName<'_>,
bool
) -> Result<(), Box<dyn RucError + 'static, Global>>
Safety Read more
sourceunsafe fn branch_create_by_base_branch_without_new_version(
&mut self,
BranchName<'_>,
ParentBranchName<'_>,
bool
) -> Result<(), Box<dyn RucError + 'static, Global>>
unsafe fn branch_create_by_base_branch_without_new_version(
&mut self,
BranchName<'_>,
ParentBranchName<'_>,
bool
) -> Result<(), Box<dyn RucError + 'static, Global>>
Safety Read more
sourceunsafe fn branch_create_by_base_branch_version_without_new_version(
&mut self,
BranchName<'_>,
ParentBranchName<'_>,
VersionName<'_>,
bool
) -> Result<(), Box<dyn RucError + 'static, Global>>
unsafe fn branch_create_by_base_branch_version_without_new_version(
&mut self,
BranchName<'_>,
ParentBranchName<'_>,
VersionName<'_>,
bool
) -> Result<(), Box<dyn RucError + 'static, Global>>
Safety Read more
sourcefn branch_exists(&self, BranchName<'_>) -> bool
fn branch_exists(&self, BranchName<'_>) -> bool
Check if a branch exists or not.
sourcefn branch_has_versions(&self, BranchName<'_>) -> bool
fn branch_has_versions(&self, BranchName<'_>) -> bool
Check if a branch exists and has versions on it.
sourcefn branch_remove(
&mut self,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
fn branch_remove(
&mut self,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
Remove a branch, remove all changes directly made by this branch. Read more
sourcefn branch_keep_only(
&mut self,
&[BranchName<'_>]
) -> Result<(), Box<dyn RucError + 'static, Global>>
fn branch_keep_only(
&mut self,
&[BranchName<'_>]
) -> Result<(), Box<dyn RucError + 'static, Global>>
Clean up all other branches not in the list,
will also clean up all orphan versions. Read more
sourcefn branch_truncate(
&mut self,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
fn branch_truncate(
&mut self,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
Remove all changes directly made by versions(bigger than
last_ver_id) of this branch. Read moresourcefn branch_truncate_to(
&mut self,
BranchName<'_>,
VersionName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
fn branch_truncate_to(
&mut self,
BranchName<'_>,
VersionName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
Remove all changes directly made by versions(bigger than
last_ver_id) of this branch. Read moresourcefn branch_pop_version(
&mut self,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
fn branch_pop_version(
&mut self,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
Remove the newest version on a specified branch. Read more
sourcefn branch_merge_to(
&mut self,
BranchName<'_>,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
fn branch_merge_to(
&mut self,
BranchName<'_>,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
Merge a branch into another.
sourceunsafe fn branch_merge_to_force(
&mut self,
BranchName<'_>,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
unsafe fn branch_merge_to_force(
&mut self,
BranchName<'_>,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
Merge a branch into another,
even if new different versions have been created on the target branch. Read more
sourcefn branch_set_default(
&mut self,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
fn branch_set_default(
&mut self,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
Make a branch to be default,
all default operations will be applied to it. Read more
sourcefn branch_is_empty(
&self,
BranchName<'_>
) -> Result<bool, Box<dyn RucError + 'static, Global>>
fn branch_is_empty(
&self,
BranchName<'_>
) -> Result<bool, Box<dyn RucError + 'static, Global>>
Check if the branch has no versions or only empty versions.
sourcefn branch_list(&self) -> Vec<BranchNameOwned, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn branch_list(&self) -> Vec<BranchNameOwned, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
NOTE Read more
sourcefn branch_get_default(&self) -> BranchNameOwned
fn branch_get_default(&self) -> BranchNameOwned
Get the default branch name.
sourceunsafe fn branch_swap(
&mut self,
BranchName<'_>,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
unsafe fn branch_swap(
&mut self,
BranchName<'_>,
BranchName<'_>
) -> Result<(), Box<dyn RucError + 'static, Global>>
Logically similar to
std::ptr::swap Read moreimpl Eq for MapxRaw
impl StructuralEq for MapxRaw
impl StructuralPartialEq for MapxRaw
Auto Trait Implementations
impl RefUnwindSafe for MapxRaw
impl Send for MapxRaw
impl Sync for MapxRaw
impl Unpin for MapxRaw
impl UnwindSafe for MapxRaw
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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
sourceimpl<T> KeyDe for Twhere
T: DeserializeOwned,
impl<T> KeyDe for Twhere
T: DeserializeOwned,
sourcefn decode_key(bytes: &[u8]) -> Result<Self>
fn decode_key(bytes: &[u8]) -> Result<Self>
Decode from bytes to the original key type.
sourceimpl<T> KeyEn for Twhere
T: Serialize,
impl<T> KeyEn for Twhere
T: Serialize,
sourcefn encode_key(&self) -> RawBytes
fn encode_key(&self) -> RawBytes
Encode original key type to bytes.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ValueDe for Twhere
T: DeserializeOwned,
impl<T> ValueDe for Twhere
T: DeserializeOwned,
sourcefn decode_value(bytes: &[u8]) -> Result<Self>
fn decode_value(bytes: &[u8]) -> Result<Self>
Decode from bytes to the original key type.
sourceimpl<T> ValueEn for Twhere
T: Serialize,
impl<T> ValueEn for Twhere
T: Serialize,
sourcefn encode_value(&self) -> RawBytes
fn encode_value(&self) -> RawBytes
Encode original key type to bytes.