Type Alias assembly_fdb::ro::ArcHandle

source ·
pub type ArcHandle<B, T> = BaseHandle<Arc<B>, T>;
Expand description

An owned, atomically-reference counted handle to a database

Aliased Type§

struct ArcHandle<B, T> { /* private fields */ }

Implementations§

source§

impl<B: AsRef<[u8]>> ArcHandle<B, ()>

source

pub fn new_arc(inner: B) -> Self

Create a new atomically-reference counted handle

source§

impl<B: AsRef<[u8]>, T: Copy> ArcHandle<B, T>

source

pub fn as_bytes_handle(&self) -> Handle<'_, T>

Borrow the atomically-reference counted handle as a byte handle

You can use this function to make cloning cheaper

source§

impl<P: Deref> BaseHandle<P, ()>
where <P as Deref>::Target: AsRef<[u8]>,

source

pub fn new(mem: P) -> Self

Creates a new handle

source§

impl<P: Deref> BaseHandle<P, ()>
where P::Target: AsRef<[u8]>,

source

pub fn into_tables(self) -> BaseResult<P, FDBHeader>

Get the tables

source§

impl<P: Deref> BaseHandle<P, FDBHeader>
where P::Target: AsRef<[u8]>,

source

pub fn into_table_at( self, index: usize, ) -> BaseResult<P, Option<FDBTableHeader>>

Get the tables

source

pub fn into_table_by_name( self, name: &Latin1Str, ) -> BaseResult<P, Option<FDBTableHeader>>

Get the tables

source§

impl<P: Deref> BaseHandle<P, FDBTableDataHeader>
where P::Target: AsRef<[u8]>,

source

pub fn get_bucket_for_hash(self, id: u32) -> BaseResult<P, FDBBucketHeader>

Get the bucket for a particular id / hash

source§

impl<P: Deref> BaseHandle<P, FDBTableHeader>
where P::Target: AsRef<[u8]>,

source

pub fn into_definition(self) -> BaseResult<P, FDBTableDefHeader>

Get the tables

source

pub fn into_data(self) -> BaseResult<P, FDBTableDataHeader>

Get the tables

source§

impl<T, P: Deref> BaseHandle<P, Option<T>>
where <P as Deref>::Target: AsRef<[u8]>,

source

pub fn transpose(self) -> Option<BaseHandle<P, T>>

Turns a handle of an option into an option of a handle

source§

impl<P: Deref, T> BaseHandle<P, T>
where <P as Deref>::Target: AsRef<[u8]>,

source

pub fn raw(&self) -> &T

Get a reference to the raw value inside

source

pub fn raw_mut(&mut self) -> &mut T

Get a reference to the raw value inside

source

pub fn as_bytes(&self) -> &[u8]

Get the byte slice for the whole database

source

pub fn replace<O>(self, raw: O) -> BaseHandle<P, O>

Replace the value that is stored with the memory pointer

source§

impl<P: Deref, T> BaseHandle<P, T>
where P::Target: AsRef<[u8]>,

source

pub fn map_into<M, O, E>(self, map: M) -> BaseResult<P, O>
where M: Fn(&[u8], T) -> Result<O, E>, E: Into<BaseErrorKind>,

Get the tables

Trait Implementations

source§

impl<P: Clone + Deref, T: Clone> Clone for BaseHandle<P, T>
where <P as Deref>::Target: AsRef<[u8]>,

source§

fn clone(&self) -> BaseHandle<P, T>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<P: Debug + Deref, T: Debug> Debug for BaseHandle<P, T>
where <P as Deref>::Target: AsRef<[u8]>,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<P, T> Copy for BaseHandle<P, T>
where P: Deref + Copy, T: Copy, <P as Deref>::Target: AsRef<[u8]>,