Union sanakirja_core::Slice

source ·
pub union Slice<'b> {
    /* private fields */
}

Implementations§

source§

impl<'a> Slice<'a>

source

pub fn as_bytes<T: LoadPage>(&self, txn: &T) -> Result<&[u8], T::Error>

Trait Implementations§

source§

impl<'a> Debug for Slice<'a>

source§

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

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

impl<'a> From<&'a [u8]> for Slice<'a>

source§

fn from(m: &'a [u8]) -> Slice<'a>

Converts to this type from the input type.
source§

impl<'a> Storable for Slice<'a>

§

type PageReferences = Pages

An iterator over the offsets to pages contained in this value. Only values from this crate can generate non-empty iterators, but combined values (like tuples) must chain the iterators returned by method page_offsets.
source§

fn page_references(&self) -> Self::PageReferences

If this value is an offset to another page at offset offset, return Some(offset). Return None else.
source§

fn compare<T: LoadPage>(&self, t: &T, b: &Self) -> Ordering

This is required for B trees, not necessarily for other structures. The default implementation panics.
source§

unsafe fn drop<T: AllocPage>(&self, txn: &mut T) -> Result<(), T::Error>

If this value is an offset to another page at offset offset, return Some(offset). Return None else. Read more
source§

impl<'b> UnsizedStorable for Slice<'b>

source§

const ALIGN: usize = 8usize

source§

fn size(&self) -> usize

If Self::SIZE.is_some(), this must return the same value. The default implementation is Self;:SIZE.unwrap().
source§

unsafe fn from_raw_ptr<'a, T>(_: &T, p: *const u8) -> &'a Self

source§

unsafe fn onpage_size(p: *const u8) -> usize

Read the size from an on-page entry. If Self::SIZE.is_some() this must be the same value.
source§

unsafe fn write_to_page_alloc<T: AllocPage>(&self, t: &mut T, p: *mut u8)

Write to a page. Must not overwrite the allocated size, but this isn’t checked (which is why it’s unsafe). Read more
source§

unsafe fn write_to_page(&self, _: *mut u8)

Write to a page. Must not overwrite the allocated size, but this isn’t checked (which is why it’s unsafe).

Auto Trait Implementations§

§

impl<'b> RefUnwindSafe for Slice<'b>

§

impl<'b> Send for Slice<'b>

§

impl<'b> Sync for Slice<'b>

§

impl<'b> Unpin for Slice<'b>

§

impl<'b> UnwindSafe for Slice<'b>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.