pub struct Slice<'buf> { /* private fields */ }Expand description
A slice of buffer data. This borrows the buffer data and can be thought of
as similar to &[T] obtained by slicing a Vec<T>.
Implementations§
Source§impl Slice<'_>
impl Slice<'_>
Sourcepub fn index_buffer<I>(&self, indices: &[I]) -> Result<Indices<'_, I>, Error>where
I: Index + Copy + Into<c_int>,
pub fn index_buffer<I>(&self, indices: &[I]) -> Result<Indices<'_, I>, Error>where
I: Index + Copy + Into<c_int>,
Get an index buffer for this slice using the given indices.
§Errors
Returns an error if:
- any of the given indices are out of bounds.
- the given slice is too long for its length to fit in a
libc::c_int.
Sourcepub unsafe fn index_buffer_unchecked<I: Index + Clone>(
&self,
indices: &[I],
) -> Indices<'_, I>
pub unsafe fn index_buffer_unchecked<I: Index + Clone>( &self, indices: &[I], ) -> Indices<'_, I>
Get an index buffer for this slice using the given indices without bounds checking.
§Safety
If any indices are outside this buffer it can cause an invalid access by the GPU (this crashes citra).
Trait Implementations§
impl<'buf> Copy for Slice<'buf>
Auto Trait Implementations§
impl<'buf> Freeze for Slice<'buf>
impl<'buf> RefUnwindSafe for Slice<'buf>
impl<'buf> Send for Slice<'buf>
impl<'buf> Sync for Slice<'buf>
impl<'buf> Unpin for Slice<'buf>
impl<'buf> UnwindSafe for Slice<'buf>
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)