Skip to main content

Writer

Struct Writer 

Source
pub struct Writer { /* private fields */ }
Expand description

Appends pages and commits a new directory for one table.

Implementations§

Source§

impl Writer

Source

pub fn create( path: impl AsRef<Path>, name: impl Into<String>, fields: Vec<Field>, ) -> Result<Self>

Creates a new v8 file and its first table.

§Errors

If the file exists, a field has no v8 scalar encoding, or the path cannot be written.

Source

pub fn append(&mut self, chunk: &Chunk) -> Result<()>

Writes one chunk as independently readable column pages.

§Errors

If its width or types differ from the declared table, or a page exceeds its bound.

Source

pub fn append_at(&mut self, order: (u64, u64), chunk: &Chunk) -> Result<()>

Writes one chunk and records its source position for directory ordering.

Pages may be encoded by parallel pipeline instances and reach the file in completion order. Their directory entries are sorted by this key at commit, so a scan still observes source order without holding the page bytes until earlier work finishes.

§Errors

The same as Self::append.

Source

pub fn finish(self) -> Result<Table>

Commits the directory and syncs the file before publishing its header slot.

§Errors

If directory encoding, writing, or syncing fails.

Trait Implementations§

Source§

impl Debug for Writer

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.