pub struct BaseHandle<P: Deref, T>{ /* private fields */ }Expand description
Base type for a handle to an in-memory data structure
This is basic layout of a handle to an in-memory FDB database.
Internally, there is a pointer (&[u8]/Box<[u8]>/Rc<[u8]>/Arc<Mmap>/…)
the memory slice as well as a value that represents the
current target.
Implementations§
Source§impl<P: Deref, T> BaseHandle<P, T>
impl<P: Deref, T> BaseHandle<P, T>
Sourcepub fn map_into<M, O, E>(self, map: M) -> BaseResult<P, O>
pub fn map_into<M, O, E>(self, map: M) -> BaseResult<P, O>
Get the tables
Source§impl<P: Deref> BaseHandle<P, ()>
impl<P: Deref> BaseHandle<P, ()>
Sourcepub fn into_tables(self) -> BaseResult<P, FDBHeader>
pub fn into_tables(self) -> BaseResult<P, FDBHeader>
Get the tables
Source§impl<P: Deref> BaseHandle<P, FDBHeader>
impl<P: Deref> BaseHandle<P, FDBHeader>
Sourcepub fn into_table_at(
self,
index: usize,
) -> BaseResult<P, Option<FDBTableHeader>>
pub fn into_table_at( self, index: usize, ) -> BaseResult<P, Option<FDBTableHeader>>
Get the tables
Sourcepub fn into_table_by_name(
self,
name: &Latin1Str,
) -> BaseResult<P, Option<FDBTableHeader>>
pub fn into_table_by_name( self, name: &Latin1Str, ) -> BaseResult<P, Option<FDBTableHeader>>
Get the tables
Source§impl<P: Deref> BaseHandle<P, FDBTableHeader>
impl<P: Deref> BaseHandle<P, FDBTableHeader>
Sourcepub fn into_definition(self) -> BaseResult<P, FDBTableDefHeader>
pub fn into_definition(self) -> BaseResult<P, FDBTableDefHeader>
Get the tables
Sourcepub fn into_data(self) -> BaseResult<P, FDBTableDataHeader>
pub fn into_data(self) -> BaseResult<P, FDBTableDataHeader>
Get the tables
Source§impl<P: Deref> BaseHandle<P, FDBTableDataHeader>
impl<P: Deref> BaseHandle<P, FDBTableDataHeader>
Sourcepub fn get_bucket_for_hash(self, id: u32) -> BaseResult<P, FDBBucketHeader>
pub fn get_bucket_for_hash(self, id: u32) -> BaseResult<P, FDBBucketHeader>
Get the bucket for a particular id / hash
Source§impl<'a> BaseHandle<Buffer<'a>, ()>
impl<'a> BaseHandle<Buffer<'a>, ()>
Source§impl<'a> BaseHandle<Buffer<'a>, FDBHeader>
impl<'a> BaseHandle<Buffer<'a>, FDBHeader>
Sourcepub fn table_count(&self) -> u32
pub fn table_count(&self) -> u32
Get the number of tables
Sourcepub fn table_header_list(&self) -> Result<'a, FDBTableHeaderSlice<'a>>
pub fn table_header_list(&self) -> Result<'a, FDBTableHeaderSlice<'a>>
Get the table header slice
Source§impl<'a> BaseHandle<Buffer<'a>, FDBTableHeader>
impl<'a> BaseHandle<Buffer<'a>, FDBTableHeader>
Sourcepub fn table_def_header(&self) -> Result<'a, FDBTableDefHeader>
pub fn table_def_header(&self) -> Result<'a, FDBTableDefHeader>
Get the table definition header
Sourcepub fn table_data_header(&self) -> Result<'a, FDBTableDataHeader>
pub fn table_data_header(&self) -> Result<'a, FDBTableDataHeader>
Get the table data header
Source§impl<'a> BaseHandle<Buffer<'a>, FDBTableDefHeader>
impl<'a> BaseHandle<Buffer<'a>, FDBTableDefHeader>
Sourcepub fn column_count(&self) -> u32
pub fn column_count(&self) -> u32
Get the number of columns
Sourcepub fn table_name(&self) -> Result<'a, &'a Latin1Str>
pub fn table_name(&self) -> Result<'a, &'a Latin1Str>
Get the name of the table
Sourcepub fn column_header_list(&self) -> Result<'a, FDBColumnHeaderSlice<'a>>
pub fn column_header_list(&self) -> Result<'a, FDBColumnHeaderSlice<'a>>
Get the column header list
Source§impl<'a> BaseHandle<Buffer<'a>, FDBColumnHeader>
impl<'a> BaseHandle<Buffer<'a>, FDBColumnHeader>
Sourcepub fn column_name(&self) -> Result<'a, &'a Latin1Str>
pub fn column_name(&self) -> Result<'a, &'a Latin1Str>
Get the name of the column
Sourcepub fn column_data_type(&self) -> StdResult<ValueType, UnknownValueType>
pub fn column_data_type(&self) -> StdResult<ValueType, UnknownValueType>
Get the type of the column
Source§impl<'a> BaseHandle<Buffer<'a>, FDBTableDataHeader>
impl<'a> BaseHandle<Buffer<'a>, FDBTableDataHeader>
Sourcepub fn bucket_count(&self) -> u32
pub fn bucket_count(&self) -> u32
Get the number of buckets
Sourcepub fn bucket_header_list(&self) -> Result<'a, FDBBucketHeaderSlice<'a>>
pub fn bucket_header_list(&self) -> Result<'a, FDBBucketHeaderSlice<'a>>
Get the slice of buckets
Source§impl<'a> BaseHandle<Buffer<'a>, FDBBucketHeader>
impl<'a> BaseHandle<Buffer<'a>, FDBBucketHeader>
Sourcepub fn first(&self) -> Option<Result<'a, FDBRowHeaderListEntry>>
pub fn first(&self) -> Option<Result<'a, FDBRowHeaderListEntry>>
Get the first row header entry or None
Sourcepub fn row_header_iter(&self) -> Handle<'a, FDBRowHeaderRef> ⓘ
pub fn row_header_iter(&self) -> Handle<'a, FDBRowHeaderRef> ⓘ
Get an iterator over all buckets
Source§impl<'a> BaseHandle<Buffer<'a>, FDBRowHeaderListEntry>
impl<'a> BaseHandle<Buffer<'a>, FDBRowHeaderListEntry>
Sourcepub fn next(&self) -> Option<Result<'a, FDBRowHeaderListEntry>>
pub fn next(&self) -> Option<Result<'a, FDBRowHeaderListEntry>>
Get the next row header list entry instance
Sourcepub fn row_header(&self) -> Result<'a, FDBRowHeader>
pub fn row_header(&self) -> Result<'a, FDBRowHeader>
Get the associated row header.
Source§impl<'a> BaseHandle<Buffer<'a>, FDBRowHeader>
impl<'a> BaseHandle<Buffer<'a>, FDBRowHeader>
Sourcepub fn field_count(&self) -> u32
pub fn field_count(&self) -> u32
Get the number of fields
Sourcepub fn field_data_list(&self) -> Result<'a, FDBFieldDataSlice<'a>>
pub fn field_data_list(&self) -> Result<'a, FDBFieldDataSlice<'a>>
Get the slice of fields
Source§impl<'a> BaseHandle<Buffer<'a>, FDBFieldData>
impl<'a> BaseHandle<Buffer<'a>, FDBFieldData>
Sourcepub fn try_get_value(&self) -> Result<'a, FDBFieldValue>
pub fn try_get_value(&self) -> Result<'a, FDBFieldValue>
Get the value from this handle
Source§impl<'a> BaseHandle<Buffer<'a>, &'a Latin1Str>
impl<'a> BaseHandle<Buffer<'a>, &'a Latin1Str>
Source§impl<B: AsRef<[u8]>, T: Copy> BaseHandle<Arc<B>, T>
impl<B: AsRef<[u8]>, T: Copy> BaseHandle<Arc<B>, T>
Sourcepub fn as_bytes_handle(&self) -> Handle<'_, T> ⓘ
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, ()>
impl<P: Deref> BaseHandle<P, ()>
Source§impl<T, P: Deref> BaseHandle<P, Option<T>>
impl<T, P: Deref> BaseHandle<P, Option<T>>
Sourcepub fn transpose(self) -> Option<BaseHandle<P, T>>
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>
impl<P: Deref, T> BaseHandle<P, T>
Sourcepub fn replace<O>(self, raw: O) -> BaseHandle<P, O>
pub fn replace<O>(self, raw: O) -> BaseHandle<P, O>
Replace the value that is stored with the memory pointer
Source§impl<'a, T> BaseHandle<Buffer<'a>, T>
impl<'a, T> BaseHandle<Buffer<'a>, T>
Source§impl<'a, T> BaseHandle<Buffer<'a>, &'a [T]>
impl<'a, T> BaseHandle<Buffer<'a>, &'a [T]>
Trait Implementations§
Source§impl<P: Clone + Deref, T: Clone> Clone for BaseHandle<P, T>
impl<P: Clone + Deref, T: Clone> Clone for BaseHandle<P, T>
Source§fn clone(&self) -> BaseHandle<P, T>
fn clone(&self) -> BaseHandle<P, T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> TryFrom<BaseHandle<Buffer<'a>, Value<FileContext>>> for Field<'a>
impl<'a> TryFrom<BaseHandle<Buffer<'a>, Value<FileContext>>> for Field<'a>
impl<P, T> Copy for BaseHandle<P, T>
Auto Trait Implementations§
impl<P, T> Freeze for BaseHandle<P, T>
impl<P, T> RefUnwindSafe for BaseHandle<P, T>where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<P, T> Send for BaseHandle<P, T>
impl<P, T> Sync for BaseHandle<P, T>
impl<P, T> Unpin for BaseHandle<P, T>
impl<P, T> UnwindSafe for BaseHandle<P, T>where
P: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<I> IntoIterator for Iwhere
I: Iterator,
impl<I> IntoIterator for Iwhere
I: Iterator,
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> PipeAsRef for T
impl<T> PipeAsRef for T
Source§impl<T> PipeBorrow for T
impl<T> PipeBorrow for T
Source§impl<T> PipeDeref for T
impl<T> PipeDeref for T
Source§impl<T> PipeRef for T
impl<T> PipeRef for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
fn tap<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
Source§fn tap_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
fn tap_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&Self) -> R,
tap in debug builds, and does nothing in release builds.Source§fn tap_mut<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
fn tap_mut<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
Source§fn tap_mut_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
fn tap_mut_dbg<F, R>(self, func: F) -> Selfwhere
F: FnOnce(&mut Self) -> R,
tap_mut in debug builds, and does nothing in release builds.Source§impl<T, U> TapAsRef<U> for Twhere
U: ?Sized,
impl<T, U> TapAsRef<U> for Twhere
U: ?Sized,
Source§fn tap_ref<F, R>(self, func: F) -> Self
fn tap_ref<F, R>(self, func: F) -> Self
Source§fn tap_ref_dbg<F, R>(self, func: F) -> Self
fn tap_ref_dbg<F, R>(self, func: F) -> Self
tap_ref in debug builds, and does nothing in release builds.Source§fn tap_ref_mut<F, R>(self, func: F) -> Self
fn tap_ref_mut<F, R>(self, func: F) -> Self
Source§impl<T, U> TapBorrow<U> for Twhere
U: ?Sized,
impl<T, U> TapBorrow<U> for Twhere
U: ?Sized,
Source§fn tap_borrow<F, R>(self, func: F) -> Self
fn tap_borrow<F, R>(self, func: F) -> Self
Source§fn tap_borrow_dbg<F, R>(self, func: F) -> Self
fn tap_borrow_dbg<F, R>(self, func: F) -> Self
tap_borrow in debug builds, and does nothing in release builds.Source§fn tap_borrow_mut<F, R>(self, func: F) -> Self
fn tap_borrow_mut<F, R>(self, func: F) -> Self
Source§impl<T> TapDeref for T
impl<T> TapDeref for T
Source§fn tap_deref_dbg<F, R>(self, func: F) -> Self
fn tap_deref_dbg<F, R>(self, func: F) -> Self
tap_deref in debug builds, and does nothing in release builds.Source§fn tap_deref_mut<F, R>(self, func: F) -> Self
fn tap_deref_mut<F, R>(self, func: F) -> Self
self for modification.