Struct BufferIndexAccessor

Source
pub struct BufferIndexAccessor<'a, R: Renderable + ?Sized> {
    pub data: &'a BufferData<'a, R>,
    pub number_indices: u32,
    pub ele_type: BufferElementType,
    pub byte_offset: u32,
    /* private fields */
}
Expand description

A subset of a BufferData, used for vertex attributes; hence for use in a vertex attribute pointer.

A BufferIndexAccessor is used for a single attribute of a set of data, such as Position or Normal.

Fields§

§data: &'a BufferData<'a, R>

The BufferData that contains the actual index data

§number_indices: u32

Number of indices in the buffer

§ele_type: BufferElementType

The type of each element

For indices this must be UInt8, UInt16 or UInt32

§byte_offset: u32

Offset from start of buffer to first byte of data

Implementations§

Source§

impl<'a, R: Renderable> BufferIndexAccessor<'a, R>

Source

pub fn new( data: &'a BufferData<'a, R>, number_indices: u32, ele_type: BufferElementType, byte_offset: u32, ) -> Self

Create a new index accessor of a BufferData

Source

pub fn create_client(&self, renderable: &mut R)

Create the render buffer required by the BufferIndexAccessor

Source

pub fn borrow_client(&self) -> Ref<'_, R::IndexAccessor>

Borrow the client

Trait Implementations§

Source§

impl<'a, R> Debug for BufferIndexAccessor<'a, R>
where R: Renderable,

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a, R: Renderable> Display for BufferIndexAccessor<'a, R>

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a, R: Renderable> DefaultIndentedDisplay for BufferIndexAccessor<'a, R>

Auto Trait Implementations§

§

impl<'a, R> !Freeze for BufferIndexAccessor<'a, R>

§

impl<'a, R> !RefUnwindSafe for BufferIndexAccessor<'a, R>

§

impl<'a, R> !Send for BufferIndexAccessor<'a, R>

§

impl<'a, R> !Sync for BufferIndexAccessor<'a, R>

§

impl<'a, R> Unpin for BufferIndexAccessor<'a, R>

§

impl<'a, R> !UnwindSafe for BufferIndexAccessor<'a, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, O, T> IndentedDisplay<'a, O> for T

Source§

fn indent(&self, ind: &mut Indenter<'a, O>) -> Result<(), Error>

Display for humans with indent
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.