pub struct RowData {
pub columns: Vec<Value>,
pub named: Option<HashMap<String, Value>>,
pub schema: Option<Arc<Vec<String>>>,
}Expand description
Data for a table row
Fields§
§columns: Vec<Value>Column values in schema order
named: Option<HashMap<String, Value>>Named column access (optional, for convenience)
schema: Option<Arc<Vec<String>>>Shared column schema: column names in order (maps index → name).
When set, columns holds the values and named is None.
This saves ~60% memory vs per-row HashMap.
Implementations§
Source§impl RowData
impl RowData
Sourcepub fn with_names(columns: Vec<Value>, names: Vec<String>) -> RowData
pub fn with_names(columns: Vec<Value>, names: Vec<String>) -> RowData
Create row data with named columns
Sourcepub fn get_field(&self, name: &str) -> Option<&Value>
pub fn get_field(&self, name: &str) -> Option<&Value>
Get a named field value — checks named HashMap first, then schema+columns.
Sourcepub fn iter_fields(&self) -> Box<dyn Iterator<Item = (&str, &Value)> + '_>
pub fn iter_fields(&self) -> Box<dyn Iterator<Item = (&str, &Value)> + '_>
Iterate over all (name, value) pairs — works for both named and columnar.
Sourcepub fn get_by_name(&self, name: &str) -> Option<&Value>
pub fn get_by_name(&self, name: &str) -> Option<&Value>
Get column by name
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RowData
impl RefUnwindSafe for RowData
impl Send for RowData
impl Sync for RowData
impl Unpin for RowData
impl UnsafeUnpin for RowData
impl UnwindSafe for RowData
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request