data_bucket 0.7.13

DataBucket is container for WorkTable's data
#![cfg_attr(not(test), no_std)]

#[macro_use]
extern crate alloc;

// The Persistable derive emits paths through the crate name, and this crate
// uses its own derive: alias ourselves so the generated code resolves here too.
extern crate self as data_bucket;

pub mod error;
pub use crate::error::report;

/// Read, write and seek capabilities used by page codecs.
///
/// Nagoya declares these traits over a portable error without requiring std.
/// Durability and file-management methods belong to the storage engine.
/// Implementations must be `Send` because page I/O can cross a task boundary.
pub trait AsyncFile: AsyncRead + AsyncWrite {}

impl<T: ?Sized> AsyncFile for T where T: AsyncRead + AsyncWrite {}

/// Read/seek capabilities needed by page decoders; no write permission or
/// durability implementation is required.
pub trait AsyncRead: nagoya::io::Read + nagoya::io::Seek + Send {}
impl<T: ?Sized> AsyncRead for T where T: nagoya::io::Read + nagoya::io::Seek + Send {}

/// Write/seek capabilities needed by page encoders.
pub trait AsyncWrite: nagoya::io::Write + nagoya::io::Seek + Send {}
impl<T: ?Sized> AsyncWrite for T where T: nagoya::io::Write + nagoya::io::Seek + Send {}

pub mod link;
/// Runtime attachment of published artifacts: mmap, leases, explicit unload.
#[cfg(feature = "loader")]
pub mod loader;
pub mod page;
pub mod persistence;
pub mod space;
pub mod storage;
pub mod util;

pub use link::Link;

pub use data_bucket_codegen::{SizeMeasure, VariableSizeMeasure};
pub use page::{
    data_page_row_capacity, get_index_page_size_from_data_length, inspect_data_page_image,
    inspect_page_image_header, map_data_pages_to_general, parse_data_page, parse_data_pages_batch,
    parse_general_header_by_index, parse_page, parse_pages_batch, persist_page,
    persist_pages_batch, seek_by_link, seek_to_page_start, update_at, DataPage, DataPageImageFacts,
    GeneralHeader, GeneralPage, IndexPage, IndexPageUtility, IndexValue, Interval, PageId,
    PageOverflowError, PageType, RowSlot, SpaceInfoPage, TableOfContentsOverflowError,
    TableOfContentsPage, UnsizedIndexPage, UnsizedIndexPageUtility, DATA_TRAILER_SIZE,
    DATA_VERSION, DEFAULT_PAGE_STRIDE, EMPTY_TABLE_OF_CONTENTS_PAGE_SIZE, GENERAL_HEADER_SIZE,
    INNER_PAGE_SIZE, PAGE_SIZE, ROW_SLOT_SIZE,
};
pub use persistence::{PersistableIndex, PersistableTable};
pub use space::Id as SpaceId;
pub use util::access_archived;
pub use util::{
    align, align8, align_to, align_vec, Persistable, SizeMeasurable, VariableSizeMeasurable,
};