pub struct BinTable { /* private fields */ }Expand description
The decoded contents of a binary table extension.
Implementations§
Source§impl BinTable
impl BinTable
Sourcepub fn push_row(
&mut self,
values: &[Value],
) -> Result<(), Box<dyn Error + Send + Sync>>
pub fn push_row( &mut self, values: &[Value], ) -> Result<(), Box<dyn Error + Send + Sync>>
Appends a row, one value per column.
This is how to build a table without going through serde — for a
complex column, say, which no Rust type maps onto on its own.
§Errors
Returns an error when values is not one per column: a short row would
leave the columns after it holding whatever the padding happened to be.
Sourcepub fn new(field_definitions: Vec<FieldDefinition>) -> Self
pub fn new(field_definitions: Vec<FieldDefinition>) -> Self
An empty table with the given columns.
Sourcepub fn field_definitions(&self) -> &[FieldDefinition]
pub fn field_definitions(&self) -> &[FieldDefinition]
The columns this table is made of.
Sourcepub fn bytes_per_row(&self) -> usize
pub fn bytes_per_row(&self) -> usize
The width of one row in bytes, as NAXIS1 gives it.
Sourcepub fn from_u8(
header: &Header,
data: Vec<u8>,
) -> Result<Self, Box<dyn Error + Send + Sync>>
pub fn from_u8( header: &Header, data: Vec<u8>, ) -> Result<Self, Box<dyn Error + Send + Sync>>
Reads a table out of a header and its data section.
Sourcepub fn row(&self, row: usize) -> Option<Row<'_>>
pub fn row(&self, row: usize) -> Option<Row<'_>>
The row at row, or None past the end of the table.
Sourcepub fn heap_len(&self) -> usize
pub fn heap_len(&self) -> usize
The size of the heap, which is what a table’s PCOUNT card records.
Sourcepub fn heap(&self) -> &[u8] ⓘ
pub fn heap(&self) -> &[u8] ⓘ
The table’s heap: the values that variable length array columns point at.
Empty for a table without such columns, which is most of them.
Sourcepub fn rows_parallel(&self) -> impl ParallelIterator<Item = Row<'_>> + '_
Available on crate feature rayon only.
pub fn rows_parallel(&self) -> impl ParallelIterator<Item = Row<'_>> + '_
rayon only.Every row of the table, decoded in parallel.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BinTable
impl RefUnwindSafe for BinTable
impl Send for BinTable
impl Sync for BinTable
impl Unpin for BinTable
impl UnsafeUnpin for BinTable
impl UnwindSafe for BinTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more