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>
pub fn to_create(&self) -> Option<MetaCreate>
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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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
impl<T> FmtForward for T
impl<T> FmtForward for T
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Formats each item in a sequence. Read more
impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
Pipes by value. This is generally the method you want to use. Read more
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read morefn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read morefn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
Borrows
self
, then passes self.as_ref()
into the pipe function.fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere
Self: Deref<Target = T>,
T: 'a + ?Sized,
R: 'a,
Borrows
self
, then passes self.deref()
into the pipe function.impl<T> Tap for T
impl<T> Tap for T
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
Immutable access to the
Borrow<B>
of a value. Read morefn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
Mutable access to the
BorrowMut<B>
of a value. Read morefn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
Immutable access to the
AsRef<R>
view of a value. Read morefn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
Mutable access to the
AsMut<R>
view of a value. Read morefn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
Immutable access to the
Deref::Target
of a value. Read morefn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Mutable access to the
Deref::Target
of a value. Read morefn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds. Read morefn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds. Read morefn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds. Read morefn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
Calls
.tap_ref()
only in debug builds, and is erased in release
builds. Read morefn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds. Read more