Skip to main content

Dataset

Struct Dataset 

Source
pub struct Dataset<'a, R: Read> {
    pub columns: Vec<Column>,
    /* private fields */
}

Fields§

§columns: Vec<Column>

Implementations§

Source§

impl<'a, R: Read> Dataset<'a, R>

Source

pub fn from_cursor( cursor: CursorImpl<StatementImpl<'a>>, ) -> MyResult<Option<Self>>

Source

pub fn from_file(reader: R, auto: bool) -> MyResult<Option<Self>>

Source

pub fn from_keywords(column: &str, records: Vec<&str>) -> Self

Source

pub fn from_tables( column1: Option<&str>, column2: Option<&str>, column3: &str, records: Vec<(&str, &str, &str)>, ) -> Self

Source

pub fn from_columns( column1: Option<&str>, column2: Option<&str>, records: Vec<(&str, &str, &str, &str, Option<&Payload>)>, ) -> Self

Source

pub fn get_columns(&self, painter: Painter) -> Vec<String>

Source

pub fn has_records(&self) -> bool

Source

pub fn get_records<F>(&self, limit: usize, function: F) -> MyResult<()>
where F: FnMut(Vec<Cow<'_, str>>) -> MyResult<()>,

Source

pub fn get_measured<F>(&self, limit: usize, function: F) -> MyResult<()>
where F: FnMut(Record, bool) -> MyResult<()>,

Source

pub fn store_records(&mut self) -> MyResult<()>

Source

pub fn push_record(&mut self, record: Vec<Cow<'_, str>>)

Source

pub fn get_widths(&self) -> Vec<Format>

Source

pub fn measure_table(&self) -> usize

Source

pub fn adjust_header(&self, header: TableHeader, interact: bool) -> TableHeader

Source

pub fn into_table( self, header: TableHeader, group: Option<&str>, ) -> TableLayout<'a, R>

Source

pub fn into_flatten(self, verbose: FlattenVerbose) -> FlattenLayout<'a, R>

Auto Trait Implementations§

§

impl<'a, R> !Freeze for Dataset<'a, R>

§

impl<'a, R> !RefUnwindSafe for Dataset<'a, R>

§

impl<'a, R> Send for Dataset<'a, R>
where R: Send,

§

impl<'a, R> !Sync for Dataset<'a, R>

§

impl<'a, R> Unpin for Dataset<'a, R>
where R: Unpin,

§

impl<'a, R> UnsafeUnpin for Dataset<'a, R>
where R: UnsafeUnpin,

§

impl<'a, R> UnwindSafe for Dataset<'a, R>
where R: UnwindSafe,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.