pub struct WireStructsCursor<'a> { /* private fields */ }Expand description
A parse-once cursor over a record-list view (T_STRUCTS_VIEW / T_STRUCTS_FVIEW): the schema
and tables are read ONCE at open, then every (row, field) access is O(1) — pure arithmetic for
the fixed-stride view, a two-u32 offset jump for the variable view — with no per-call re-scan.
Implementations§
Source§impl<'a> WireStructsCursor<'a>
impl<'a> WireStructsCursor<'a>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn field_count(&self) -> usize
Sourcepub fn field_index(&self, name: &str) -> Option<usize>
pub fn field_index(&self, name: &str) -> Option<usize>
Index of the field named name, scanned once by the caller and then reused for every row.
Sourcepub fn value(&self, row: usize, fi: usize) -> Option<RuntimeValue>
pub fn value(&self, row: usize, fi: usize) -> Option<RuntimeValue>
The (row, field) value as an owned RuntimeValue — O(1), no header re-scan.
Sourcepub fn i64_column(&self, fi: usize) -> Option<Vec<i64>>
pub fn i64_column(&self, fi: usize) -> Option<Vec<i64>>
Read an ENTIRE int field of the fixed-stride view as a Vec<i64> in one tight pass — the
Cap’n-Proto-class read-all: the cells are at a fixed offset every stride bytes, so after
one bounds check on the last cell, the reads are unchecked raw 8-byte loads (no per-read
bounds check, no slice indirection, no RuntimeValue box). None for the variable view
(varint cells aren’t strided) or a non-int field.
Auto Trait Implementations§
impl<'a> Freeze for WireStructsCursor<'a>
impl<'a> RefUnwindSafe for WireStructsCursor<'a>
impl<'a> Send for WireStructsCursor<'a>
impl<'a> Sync for WireStructsCursor<'a>
impl<'a> Unpin for WireStructsCursor<'a>
impl<'a> UnsafeUnpin for WireStructsCursor<'a>
impl<'a> UnwindSafe for WireStructsCursor<'a>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.