Revert Data fields to bytes and add get_data_as_view for zero-copy access (#390)

* get data field with view

* refine tc

* refine based on flake check

* run black again

* rebase upstream master

* add comment to tc

* refine raise exception
This commit is contained in:
Brian Xu
2026-01-16 16:40:22 +11:00
committed by GitHub
parent 9754258d46
commit 9237ba123a
4 changed files with 265 additions and 7 deletions

View File

@@ -65,6 +65,7 @@ cdef class _DynamicStructReader:
cpdef _which_str(self)
cpdef _get_by_field(self, _StructSchemaField field)
cpdef _has_by_field(self, _StructSchemaField field)
cpdef get_data_as_view(self, field)
cpdef as_builder(self, num_first_segment_words=?, allocate_seg_callable=?)
@@ -97,6 +98,7 @@ cdef class _DynamicStructBuilder:
cpdef _which_str(self)
cpdef adopt(self, field, _DynamicOrphan orphan)
cpdef disown(self, field)
cpdef get_data_as_view(self, field)
cpdef as_reader(self)
cpdef copy(self, num_first_segment_words=?, allocate_seg_callable=?)