pub trait SliceBuffer<'a>
where Self: 'a,
{ type SliceType: BorrowedBuffer<'a> + Sized; // Required method fn slice(&'a self, range: Range<usize>) -> Self::SliceType; }
Expand description

Trait for buffers that support slicing, similar to the builtin slice type

Note

If there would be better support for custom DSTs, the BufferSlice type could be a DST and we could use the Index trait instead.

Required Associated Types§

source

type SliceType: BorrowedBuffer<'a> + Sized

The slice type

Required Methods§

source

fn slice(&'a self, range: Range<usize>) -> Self::SliceType

Take a immutable slice to this buffer using the given range of points

Panics

May panic if range is out of bounds

Implementors§