Trait sanakirja_core::UnsizedStorable[][src]

pub trait UnsizedStorable: Storable {
    const ALIGN: usize;

    fn size(&self) -> usize;
unsafe fn onpage_size(_: *const u8) -> usize;
unsafe fn write_to_page(&self, p: *mut u8);
unsafe fn from_raw_ptr<'a, T>(_: &T, p: *const u8) -> &'a Self; }

Types that can be stored on disk.

Associated Constants

const ALIGN: usize[src]

Loading content...

Required methods

fn size(&self) -> usize[src]

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

unsafe fn onpage_size(_: *const u8) -> usize[src]

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

unsafe fn write_to_page(&self, p: *mut u8)[src]

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

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

Loading content...

Implementors

impl UnsizedStorable for ()[src]

fn size(&self) -> usize[src]

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

unsafe fn onpage_size(_: *const u8) -> usize[src]

Read the size from an on-page entry.

unsafe fn write_to_page(&self, p: *mut u8)[src]

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

impl UnsizedStorable for [u8; 16][src]

fn size(&self) -> usize[src]

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

unsafe fn onpage_size(_: *const u8) -> usize[src]

Read the size from an on-page entry.

unsafe fn write_to_page(&self, p: *mut u8)[src]

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

impl UnsizedStorable for [u8][src]

impl UnsizedStorable for i8[src]

fn size(&self) -> usize[src]

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

unsafe fn onpage_size(_: *const u8) -> usize[src]

Read the size from an on-page entry.

unsafe fn write_to_page(&self, p: *mut u8)[src]

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

impl UnsizedStorable for i16[src]

fn size(&self) -> usize[src]

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

unsafe fn onpage_size(_: *const u8) -> usize[src]

Read the size from an on-page entry.

unsafe fn write_to_page(&self, p: *mut u8)[src]

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

impl UnsizedStorable for i32[src]

fn size(&self) -> usize[src]

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

unsafe fn onpage_size(_: *const u8) -> usize[src]

Read the size from an on-page entry.

unsafe fn write_to_page(&self, p: *mut u8)[src]

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

impl UnsizedStorable for i64[src]

fn size(&self) -> usize[src]

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

unsafe fn onpage_size(_: *const u8) -> usize[src]

Read the size from an on-page entry.

unsafe fn write_to_page(&self, p: *mut u8)[src]

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

impl UnsizedStorable for u8[src]

fn size(&self) -> usize[src]

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

unsafe fn onpage_size(_: *const u8) -> usize[src]

Read the size from an on-page entry.

unsafe fn write_to_page(&self, p: *mut u8)[src]

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

impl UnsizedStorable for u16[src]

fn size(&self) -> usize[src]

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

unsafe fn onpage_size(_: *const u8) -> usize[src]

Read the size from an on-page entry.

unsafe fn write_to_page(&self, p: *mut u8)[src]

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

impl UnsizedStorable for u32[src]

fn size(&self) -> usize[src]

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

unsafe fn onpage_size(_: *const u8) -> usize[src]

Read the size from an on-page entry.

unsafe fn write_to_page(&self, p: *mut u8)[src]

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

impl UnsizedStorable for u64[src]

fn size(&self) -> usize[src]

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

unsafe fn onpage_size(_: *const u8) -> usize[src]

Read the size from an on-page entry.

unsafe fn write_to_page(&self, p: *mut u8)[src]

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

Loading content...