pub struct ResultSet { /* private fields */ }Expand description
Database query result set
Implementations§
Source§impl ResultSet
impl ResultSet
pub fn new(columns: Vec<String>) -> Self
pub fn add_row(&mut self, row: Row)
pub fn rows(&self) -> &[Row]
pub fn columns(&self) -> &[String]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn execution_time(&self) -> Duration
pub fn set_execution_time(&mut self, time: Duration)
Sourcepub fn to_array2(&self) -> Result<Array2<f64>, DatabaseError>
pub fn to_array2(&self) -> Result<Array2<f64>, DatabaseError>
Convert result set to ndarray Array2<f64> for ML processing
Sourcepub fn column_to_array1(
&self,
column: &str,
) -> Result<Array1<f64>, DatabaseError>
pub fn column_to_array1( &self, column: &str, ) -> Result<Array1<f64>, DatabaseError>
Convert specific column to Array1<f64>
Sourcepub fn unique_values(&self, column: &str) -> Result<Vec<Value>, DatabaseError>
pub fn unique_values(&self, column: &str) -> Result<Vec<Value>, DatabaseError>
Get unique values from a column
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResultSet
impl RefUnwindSafe for ResultSet
impl Send for ResultSet
impl Sync for ResultSet
impl Unpin for ResultSet
impl UnwindSafe for ResultSet
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
Mutably borrows from an owned value. Read more
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>
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 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>
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