pub struct RawBlock { /* private fields */ }Expand description
Raw data block format (B for bytes):
+-----+----------+---------------+-----------+-----------------------+-----------------+
| len | group id | col_schema... | length... | (bitmap or offsets | col data) ... |
| 4B | 8B | (2+4)B * cols | 4B * cols | (row+7)/8 or 4 * rows | length[col] ... |
+-----+----------+---------------+-----------+-----------------------+-----------------+The length of bitmap is decided by number of rows of this data block, and the length of each column data is recorded in the first segment, next to the struct header
Implementations
sourceimpl RawBlock
impl RawBlock
pub unsafe fn parse_from_ptr(ptr: *mut c_void, precision: Precision) -> Self
pub fn parse_from_ptr_v2(
_ptr: *const *const c_void,
_fields: &[Field],
_lengths: &[u32],
_rows: usize,
_precision: Precision
) -> Self
pub fn parse_from_raw_block_v2(
bytes: impl Into<Bytes>,
fields: &[Field],
lengths: &[u32],
rows: usize,
precision: Precision
) -> Self
pub fn parse_from_raw_block(
bytes: impl Into<Bytes>,
precision: Precision
) -> Self
sourcepub fn with_database_name(&mut self, name: impl Into<String>) -> &mut Self
pub fn with_database_name(&mut self, name: impl Into<String>) -> &mut Self
Set table name of the block
sourcepub fn with_table_name(&mut self, name: impl Into<String>) -> &mut Self
pub fn with_table_name(&mut self, name: impl Into<String>) -> &mut Self
Set table name of the block
sourcepub fn with_field_names<S: Into<String>, I: IntoIterator<Item = S>>(
&mut self,
names: I
) -> &mut Self
pub fn with_field_names<S: Into<String>, I: IntoIterator<Item = S>>(
&mut self,
names: I
) -> &mut Self
Set field names of the block
pub const fn group_id(&self) -> u64
pub fn table_name(&self) -> Option<&str>
pub fn tmq_db_name(&self) -> Option<&str>
pub fn schemas(&self) -> &[ColSchema]
sourcepub fn field_names(&self) -> &[String]
pub fn field_names(&self) -> &[String]
Get field names.
sourcepub fn columns(&self) -> Iter<'_, ColumnView>
pub fn columns(&self) -> Iter<'_, ColumnView>
Data view in columns.
sourcepub fn rows<'a>(&self) -> RowsIter<'a>ⓘNotable traits for RowsIter<'a>impl<'a> Iterator for RowsIter<'a> type Item = RowView<'a>;
pub fn rows<'a>(&self) -> RowsIter<'a>ⓘNotable traits for RowsIter<'a>impl<'a> Iterator for RowsIter<'a> type Item = RowView<'a>;
Data view in rows.
pub fn into_rows<'a>(self) -> IntoRowsIter<'a>ⓘNotable traits for IntoRowsIter<'a>impl<'a> Iterator for IntoRowsIter<'a> type Item = RowView<'a>; where
Self: 'a,
pub fn deserialize<'de, 'a: 'de, T>(
&'a self
) -> Map<RowsIter<'_>, fn(_: RowView<'a>) -> Result<T, Error>> where
T: Deserialize<'de>,
pub fn as_raw_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn is_null(&self, row: usize, col: usize) -> bool
sourcepub unsafe fn get_raw_value_unchecked(
&self,
row: usize,
col: usize
) -> (Ty, u32, *const c_void)
pub unsafe fn get_raw_value_unchecked(
&self,
row: usize,
col: usize
) -> (Ty, u32, *const c_void)
Get one value at (row, col) of the block.
pub fn get_ref(&self, row: usize, col: usize) -> Option<BorrowedValue<'_>>
sourcepub unsafe fn get_ref_unchecked(
&self,
row: usize,
col: usize
) -> BorrowedValue<'_>
pub unsafe fn get_ref_unchecked(
&self,
row: usize,
col: usize
) -> BorrowedValue<'_>
Get one value at (row, col) of the block.
pub fn to_values(&self) -> Vec<Vec<Value>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
pub fn write<W: Write>(&self, _wtr: W) -> Result<usize>
Trait Implementations
sourceimpl AsyncInlinable for RawBlock
impl AsyncInlinable for RawBlock
fn read_optional_inlined<'life0, 'async_trait, R>(
reader: &'life0 mut R
) -> Pin<Box<dyn Future<Output = Result<Option<Self>>> + Send + 'async_trait>> where
R: 'async_trait + AsyncRead + Send + Unpin,
'life0: 'async_trait,
Self: 'async_trait,
sourcefn read_inlined<'life0, 'async_trait, R>(
reader: &'life0 mut R
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>> where
R: 'async_trait + AsyncRead + Send + Unpin,
'life0: 'async_trait,
Self: 'async_trait,
fn read_inlined<'life0, 'async_trait, R>(
reader: &'life0 mut R
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>> where
R: 'async_trait + AsyncRead + Send + Unpin,
'life0: 'async_trait,
Self: 'async_trait,
Read inlined bytes into object.
sourcefn write_inlined<'life0, 'life1, 'async_trait, W>(
&'life0 self,
wtr: &'life1 mut W
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>> where
W: 'async_trait + AsyncWrite + Send + Unpin,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn write_inlined<'life0, 'life1, 'async_trait, W>(
&'life0 self,
wtr: &'life1 mut W
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>> where
W: 'async_trait + AsyncWrite + Send + Unpin,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Write inlined bytes to a writer.
sourcefn write_inlined_with<'life0, 'life1, 'async_trait, W>(
&'life0 self,
wtr: &'life1 mut W,
_opts: InlineOpts
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>> where
W: 'async_trait + AsyncWrite + Send + Unpin,
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
fn write_inlined_with<'life0, 'life1, 'async_trait, W>(
&'life0 self,
wtr: &'life1 mut W,
_opts: InlineOpts
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>> where
W: 'async_trait + AsyncWrite + Send + Unpin,
'life0: 'async_trait,
'life1: 'async_trait,
Self: Sync + 'async_trait,
Write inlined bytes with specific options
sourceimpl Inlinable for RawBlock
impl Inlinable for RawBlock
sourcefn read_inlined<R: Read>(reader: &mut R) -> Result<Self>
fn read_inlined<R: Read>(reader: &mut R) -> Result<Self>
Read inlined bytes into object.
fn read_optional_inlined<R: Read>(reader: &mut R) -> Result<Option<Self>>
sourcefn write_inlined<W: Write>(&self, wtr: &mut W) -> Result<usize>
fn write_inlined<W: Write>(&self, wtr: &mut W) -> Result<usize>
Write inlined bytes to a writer.
sourcefn write_inlined_with<W: Write>(
&self,
wtr: &mut W,
_opts: InlineOpts
) -> Result<usize>
fn write_inlined_with<W: Write>(
&self,
wtr: &mut W,
_opts: InlineOpts
) -> Result<usize>
Write inlined bytes with specific options
sourcefn inlined(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn inlined(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Get inlined bytes as vector.
sourcefn printable_inlined(&self) -> String
fn printable_inlined(&self) -> String
Get inlined bytes as printable string, all the bytes will displayed with escaped ascii code.
impl Send for RawBlock
impl Sync for RawBlock
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more