Struct google_cloud_spanner::row::Row
source · pub struct Row { /* private fields */ }Implementations§
source§impl Row
impl Row
sourcepub fn new(
index: Arc<HashMap<String, usize>>,
fields: Arc<Vec<Field>>,
values: Vec<Value>
) -> Row
pub fn new(
index: Arc<HashMap<String, usize>>,
fields: Arc<Vec<Field>>,
values: Vec<Value>
) -> Row
Examples found in repository?
src/reader.rs (line 110)
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
fn next(&mut self) -> Option<Row> {
if !self.rows.is_empty() {
let column_length = self.fields.len();
let target_record_is_chunked = self.rows.len() < column_length;
let target_record_contains_chunked_value = self.chunked_value && self.rows.len() == column_length;
if !target_record_is_chunked && !target_record_contains_chunked_value {
// get column_length values
let mut values = Vec::with_capacity(column_length);
for _ in 0..column_length {
values.push(self.rows.pop_front().unwrap());
}
return Some(Row::new(Arc::clone(&self.index), Arc::clone(&self.fields), values));
}
}
None
}pub fn column_by_name<T>(&self, column_name: &str) -> Result<T, Error>where
T: TryFromValue,
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Row
impl Send for Row
impl Sync for Row
impl Unpin for Row
impl UnwindSafe for Row
Blanket Implementations§
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> 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