Trait sanakirja::UnsizedStorable[][src]

pub trait UnsizedStorable: Storable {
    pub const ALIGN: usize;

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

Types that can be stored on disk.

Associated Constants

pub const ALIGN: usize[src]

Loading content...

Required methods

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

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

pub 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.

pub 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).

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

Loading content...

Implementations on Foreign Types

impl UnsizedStorable for u8[src]

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

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

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

Read the size from an on-page entry.

pub 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]

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

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

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

Read the size from an on-page entry.

pub 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]

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

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

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

Read the size from an on-page entry.

pub 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]

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

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

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

Read the size from an on-page entry.

pub 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]

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

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

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

Read the size from an on-page entry.

pub 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 ()[src]

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

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

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

Read the size from an on-page entry.

pub 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]

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

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

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

Read the size from an on-page entry.

pub 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]

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

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

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

Read the size from an on-page entry.

pub 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]

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

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

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

Read the size from an on-page entry.

pub 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 i8[src]

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

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

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

Read the size from an on-page entry.

pub 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...

Implementors

Loading content...