Skip to main content

Table

Struct Table 

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

A parsed DBF header plus the record area it describes.

Implementations§

Source§

impl Table

Source

pub fn new(data: DbfData, opts: &ReadOptions) -> Result<Table, Error>

Validate the header of data and decide which columns to read and with which types.

Source

pub fn fields(&self) -> &[Field]

All fields declared in the header, selected or not.

Source

pub fn columns(&self) -> impl ExactSizeIterator<Item = &Field> + '_

Selected columns, in file order.

Source

pub fn n_cols(&self) -> usize

Source

pub fn n_rows(&self) -> usize

Number of rows that reading will produce (live records, capped by n_max).

Source

pub fn declared_records(&self) -> u32

Record count declared in the header (includes deleted records).

Source

pub fn encoding(&self) -> Encoding

Source

pub fn warnings(&self) -> &[String]

Non-fatal problems found in the file (e.g. missing records).

Source

pub fn unmatched_select(&self) -> &[String]

Names in select that matched no field.

Source

pub fn data(&self) -> &DbfData

Source

pub fn read_rows<S: Sink>( &self, cursor: &mut Cursor, max_rows: usize, sink: &mut S, ) -> usize

Decode up to max_rows rows starting at cursor, pushing the values into sink. Returns the number of rows decoded; 0 means the end.

Source§

impl Table

Source

pub fn collect(&self) -> Vec<ColumnData>

Read every row into owned columns (text decoded to UTF-8).

Auto Trait Implementations§

§

impl Forget for Table

§

impl Freeze for Table

§

impl Move for Table

§

impl RefUnwindSafe for Table

§

impl Send for Table

§

impl Sync for Table

§

impl Unpin for Table

§

impl UnsafeUnpin for Table

§

impl UnwindSafe for Table

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.