pub trait ColumnCursor:
Debug
+ Clone
+ Copy
+ PartialEq
+ Default {
type Item: Packable + ?Sized;
type State<'a>: EncoderState<'a, Self::Item>
where <Self as ColumnCursor>::Item: 'a;
type PostState<'a>: Debug
where Self::Item: 'a;
type Export: Debug + PartialEq + Clone;
type SlabIndex: Debug + Clone + HasPos + HasAcc + SpanWeight<Slab>;
Show 31 methods
// Required methods
fn empty() -> Self;
fn finalize_state<'a>(
slab: &'a Slab,
encoder: &mut Encoder<'a, Self>,
post: Self::PostState<'a>,
cursor: Self,
) -> Option<Self>;
fn finish<'a>(
slab: &'a Slab,
writer: &mut SlabWriter<'a, Self::Item>,
cursor: Self,
);
fn copy_between<'a>(
slab: &'a [u8],
writer: &mut SlabWriter<'a, Self::Item>,
c0: Self,
c1: Self,
run: Run<'a, Self::Item>,
size: usize,
) -> Self::State<'a>;
fn splice_encoder(
index: usize,
del: usize,
slab: &Slab,
) -> SpliceEncoder<'_, Self>;
fn slab_size() -> usize;
fn try_next<'a>(
&mut self,
data: &'a [u8],
) -> Result<Option<Run<'a, Self::Item>>, PackError>;
fn export_splice<'a, I>(
data: &mut Vec<Self::Export>,
range: Range<usize>,
values: I,
)
where I: Iterator<Item = Option<Cow<'a, Self::Item>>>,
Self::Item: 'a;
fn index(&self) -> usize;
fn offset(&self) -> usize;
fn load_with(
data: &[u8],
m: &ScanMeta,
) -> Result<ColumnData<Self>, PackError>;
// Provided methods
fn encode<'a, I>(out: &mut Vec<u8>, values: I, force: bool) -> Range<usize>
where I: Iterator<Item = Option<Cow<'a, Self::Item>>>,
Self::Item: 'a { ... }
fn new(_: &Slab) -> Self { ... }
fn iter(slab: &[u8]) -> CursorIter<'_, Self> ⓘ { ... }
fn compute_min_max(_slabs: &mut [Slab]) { ... }
fn is_empty(v: Option<Cow<'_, Self::Item>>) -> bool { ... }
fn contains_range(
&self,
run: &Run<'_, Self::Item>,
range: &Range<usize>,
) -> Option<Range<usize>> { ... }
fn contains(
&self,
run: &Run<'_, Self::Item>,
target: Agg,
) -> Option<Range<usize>> { ... }
fn contains_agg(
&self,
run: &Run<'_, Self::Item>,
agg: Agg,
) -> Option<Range<usize>> { ... }
fn pop<'a>(
&self,
run: &mut Run<'a, Self::Item>,
) -> Option<Option<Cow<'a, Self::Item>>> { ... }
fn pop_n<'a>(
&self,
run: &mut Run<'a, Self::Item>,
n: usize,
) -> Option<Option<Cow<'a, Self::Item>>> { ... }
fn next<'a>(&mut self, data: &'a [u8]) -> Option<Run<'a, Self::Item>> { ... }
fn acc(&self) -> Acc { ... }
fn min(&self) -> Agg { ... }
fn max(&self) -> Agg { ... }
fn seek(index: usize, slab: &Slab) -> (Option<Run<'_, Self::Item>>, Self) { ... }
fn debug_scan(data: &[u8], m: &ScanMeta) -> Result<Self, PackError> { ... }
fn load(data: &[u8]) -> Result<ColumnData<Self>, PackError> { ... }
fn splice<'a, 'b, I, M>(
slab: &'a Slab,
index: usize,
del: usize,
values: I,
debug: (&mut Vec<Self::Export>, Range<usize>),
) -> SpliceResult
where M: MaybePackable<'b, Self::Item>,
I: Iterator<Item = M>,
Self::Item: 'b { ... }
fn splice_delete<'a>(
_post: Option<Run<'a, Self::Item>>,
_cursor: Self,
_del: usize,
slab: &'a Slab,
) -> SpliceDel<'a, Self> { ... }
fn init_empty(len: usize) -> Slab { ... }
}Required Associated Types§
type Item: Packable + ?Sized
type State<'a>: EncoderState<'a, Self::Item> where <Self as ColumnCursor>::Item: 'a
type PostState<'a>: Debug where Self::Item: 'a
type Export: Debug + PartialEq + Clone
type SlabIndex: Debug + Clone + HasPos + HasAcc + SpanWeight<Slab>
Required Methods§
fn empty() -> Self
fn finalize_state<'a>( slab: &'a Slab, encoder: &mut Encoder<'a, Self>, post: Self::PostState<'a>, cursor: Self, ) -> Option<Self>
fn finish<'a>( slab: &'a Slab, writer: &mut SlabWriter<'a, Self::Item>, cursor: Self, )
fn copy_between<'a>( slab: &'a [u8], writer: &mut SlabWriter<'a, Self::Item>, c0: Self, c1: Self, run: Run<'a, Self::Item>, size: usize, ) -> Self::State<'a>
fn splice_encoder( index: usize, del: usize, slab: &Slab, ) -> SpliceEncoder<'_, Self>
fn slab_size() -> usize
fn try_next<'a>( &mut self, data: &'a [u8], ) -> Result<Option<Run<'a, Self::Item>>, PackError>
fn export_splice<'a, I>( data: &mut Vec<Self::Export>, range: Range<usize>, values: I, )
fn index(&self) -> usize
fn offset(&self) -> usize
fn load_with(data: &[u8], m: &ScanMeta) -> Result<ColumnData<Self>, PackError>
Provided Methods§
fn encode<'a, I>(out: &mut Vec<u8>, values: I, force: bool) -> Range<usize>
fn new(_: &Slab) -> Self
fn iter(slab: &[u8]) -> CursorIter<'_, Self> ⓘ
fn compute_min_max(_slabs: &mut [Slab])
fn is_empty(v: Option<Cow<'_, Self::Item>>) -> bool
fn contains_range( &self, run: &Run<'_, Self::Item>, range: &Range<usize>, ) -> Option<Range<usize>>
fn contains( &self, run: &Run<'_, Self::Item>, target: Agg, ) -> Option<Range<usize>>
fn contains_agg( &self, run: &Run<'_, Self::Item>, agg: Agg, ) -> Option<Range<usize>>
fn pop<'a>( &self, run: &mut Run<'a, Self::Item>, ) -> Option<Option<Cow<'a, Self::Item>>>
fn pop_n<'a>( &self, run: &mut Run<'a, Self::Item>, n: usize, ) -> Option<Option<Cow<'a, Self::Item>>>
fn next<'a>(&mut self, data: &'a [u8]) -> Option<Run<'a, Self::Item>>
fn acc(&self) -> Acc
fn min(&self) -> Agg
fn max(&self) -> Agg
fn seek(index: usize, slab: &Slab) -> (Option<Run<'_, Self::Item>>, Self)
fn debug_scan(data: &[u8], m: &ScanMeta) -> Result<Self, PackError>
fn load(data: &[u8]) -> Result<ColumnData<Self>, PackError>
fn splice<'a, 'b, I, M>( slab: &'a Slab, index: usize, del: usize, values: I, debug: (&mut Vec<Self::Export>, Range<usize>), ) -> SpliceResult
fn splice_delete<'a>( _post: Option<Run<'a, Self::Item>>, _cursor: Self, _del: usize, slab: &'a Slab, ) -> SpliceDel<'a, Self>
fn init_empty(len: usize) -> Slab
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.