Struct matterdb::access::Prefixed [−][src]
Access that prepends the specified prefix to each created view. The prefix is separated
from user-provided names with a dot char '.'
.
Since the prefix itself cannot contain a dot, Prefixed
accesses provide namespace
separation. A set of indexes to which Prefixed
provides access does not intersect
with a set of indexes accessed by a Prefixed
instance with another prefix. Additionally,
index in Prefixed
accesses do not intersect with indexes in special-purpose Access
implementations (Migration
s and Scratchpad
s).
Examples
use matterdb::{access::{AccessExt, CopyAccessExt, Prefixed}, Database, TemporaryDB}; let db = TemporaryDB::new(); let fork = db.fork(); let prefixed = Prefixed::new("prefixed", &fork); prefixed.get_list("list").extend(vec![1_u32, 2, 3]); let same_list = fork.get_list::<_, u32>("prefixed.list"); assert_eq!(same_list.len(), 3);
Implementations
impl<T: RawAccess> Prefixed<T>
[src]
Trait Implementations
impl<T: RawAccess> Access for Prefixed<T>
[src]
type Base = T
Raw access serving as the basis for created indexes.
fn get_index_metadata(
self,
addr: IndexAddress
) -> Result<Option<IndexMetadata>, AccessError>
[src]
self,
addr: IndexAddress
) -> Result<Option<IndexMetadata>, AccessError>
fn get_or_create_view(
self,
addr: IndexAddress,
index_type: IndexType
) -> Result<ViewWithMetadata<Self::Base>, AccessError>
[src]
self,
addr: IndexAddress,
index_type: IndexType
) -> Result<ViewWithMetadata<Self::Base>, AccessError>
fn group_keys<K: ?Sized>(
self,
base_addr: IndexAddress
) -> GroupKeys<Self::Base, K> where
K: BinaryKey,
Self::Base: AsReadonly<Readonly = Self::Base>,
[src]
self,
base_addr: IndexAddress
) -> GroupKeys<Self::Base, K> where
K: BinaryKey,
Self::Base: AsReadonly<Readonly = Self::Base>,
impl<T: Clone> Clone for Prefixed<T>
[src]
impl<T: Debug> Debug for Prefixed<T>
[src]
impl<T: RawAccess> From<Prefixed<T>> for GenericAccess<T>
[src]
impl<'a, T> IntoErased<'a> for Prefixed<T> where
T: Into<GenericRawAccess<'a>>,
[src]
T: Into<GenericRawAccess<'a>>,
fn into_erased(self) -> ErasedAccess<'a>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Prefixed<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Prefixed<T> where
T: Send,
T: Send,
impl<T> Sync for Prefixed<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Prefixed<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Prefixed<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,