pub struct Row<'a> {
pub table_index: i64,
pub row_index: Option<i64>,
pub range_index: Option<i64>,
/* private fields */
}Expand description
A single input row, borrowed from the reader’s buffer.
The row is not decoded until you ask for it, so a job that only forwards
rows never pays to parse them — see Row::raw.
Fields§
§table_index: i64Index of the input table this row came from.
Stays 0 unless the operation enables control_attributes.enable_table_index.
row_index: Option<i64>Index of this row within its input table, if enable_row_index is set.
range_index: Option<i64>Index of the requested range this row came from, if enable_range_index is set.
Implementations§
Source§impl<'a> Row<'a>
impl<'a> Row<'a>
Sourcepub fn raw(&self) -> &'a [u8] ⓘ
pub fn raw(&self) -> &'a [u8] ⓘ
The row’s raw YSON bytes, exactly as they arrived.
Writing these straight to an output table reproduces the row byte-for-byte, which decoding and re-encoding does not guarantee (map keys come back sorted). This is what an identity job should use.
Sourcepub fn offset(&self) -> u64
pub fn offset(&self) -> u64
Offset of this row from the start of the input stream, for diagnostics.
Sourcepub fn parse<T: Deserialize<'a>>(&self) -> Result<T>
pub fn parse<T: Deserialize<'a>>(&self) -> Result<T>
Decodes the row into T.
T may borrow from the row (&str, &[u8]), which avoids copying
string columns; such a T cannot outlive this row.
§Errors
Returns JobError::Yson if the row does not match T’s shape.