Skip to main content

VisitorVTable

Trait VisitorVTable 

Source
pub trait VisitorVTable<V: VTable> {
    // Required methods
    fn visit_buffers(array: &V::Array, visitor: &mut dyn ArrayBufferVisitor);
    fn visit_children(array: &V::Array, visitor: &mut dyn ArrayChildVisitor);

    // Provided methods
    fn nbuffers(array: &V::Array) -> usize { ... }
    fn buffer_names(array: &V::Array) -> Vec<String> { ... }
    fn visit_children_unnamed(
        array: &V::Array,
        visitor: &mut dyn ArrayChildVisitorUnnamed,
    ) { ... }
    fn nchildren(array: &V::Array) -> usize { ... }
    fn nth_child(array: &V::Array, idx: usize) -> Option<ArrayRef> { ... }
}

Required Methods§

Source

fn visit_buffers(array: &V::Array, visitor: &mut dyn ArrayBufferVisitor)

Visit the buffers of the array.

Source

fn visit_children(array: &V::Array, visitor: &mut dyn ArrayChildVisitor)

Visit the children of the array.

Provided Methods§

Source

fn nbuffers(array: &V::Array) -> usize

Count the number of buffers in the array.

Source

fn buffer_names(array: &V::Array) -> Vec<String>

Return the names of the buffers in the array.

Source

fn visit_children_unnamed( array: &V::Array, visitor: &mut dyn ArrayChildVisitorUnnamed, )

Visit the children of the array without names.

This is more efficient than Self::visit_children when you don’t need the child names (e.g., for counting or accessing by index). The default implementation wraps the named visitor, but array types can override this to avoid allocating names.

Source

fn nchildren(array: &V::Array) -> usize

Count the number of children in the array.

Source

fn nth_child(array: &V::Array, idx: usize) -> Option<ArrayRef>

Get the nth child of the array without allocating a Vec.

Returns None if the index is out of bounds.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§