pub struct Column { /* private fields */ }Expand description
A read-only dense column.
Implementations§
Source§impl Column
impl Column
Sourcepub fn file(store: &Path, name: &str) -> PathBuf
pub fn file(store: &Path, name: &str) -> PathBuf
The side file the name column of the store at store is written to.
The name carries the store’s own stem, so two stores in one directory cannot write each other’s columns.
Sourcepub fn write_to<'a>(
count: u32,
records: impl IntoIterator<Item = (Ordinal, &'a [u8])>,
out: &mut impl Write,
) -> Result<()>
pub fn write_to<'a>( count: u32, records: impl IntoIterator<Item = (Ordinal, &'a [u8])>, out: &mut impl Write, ) -> Result<()>
Writes the column records pack, in ordinal order.
A record is placed at its ordinal, and an ordinal no record names gets an empty range. The records are borrowed rather than packed into one buffer first, so a build writes an edition’s column without holding a second copy of it.
§Errors
Returns the I/O error from writing.
Sourcepub fn read_from(reader: &mut impl Read) -> Result<Self, ColumnError>
pub fn read_from(reader: &mut impl Read) -> Result<Self, ColumnError>
Reads a column, checking its offsets once so a read never can.
The records land in one allocation of their final size, filled from the reader, so the column arrives at the address it is served from.
§Errors
Returns ColumnError when the bytes end early, an offset lies behind
the one before it, or the reader fails.
Sourcepub fn read(bytes: &[u8]) -> Result<Self, ColumnError>
pub fn read(bytes: &[u8]) -> Result<Self, ColumnError>
Sourcepub fn size_in_bytes(&self) -> usize
pub fn size_in_bytes(&self) -> usize
The heap bytes this column holds
(concept_graph::footprint).