Struct BufferDataAccessor

Source
pub struct BufferDataAccessor<'a, R: Renderable> { /* private fields */ }
Expand description

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

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

Implementations§

Source§

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

Source

pub fn new(desc: &'a BufferDescriptor<'a, R>, desc_index: u8) -> Self

Create a new view of a BufferData

Source

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

Create the render buffer required by the BufferDataAccessor

Source

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

Borrow the client

Source

pub fn desc_index(&self) -> u8

desc_index

Source

pub fn desc(&self) -> &BufferDescriptor<'a, R>

desc

Source

pub fn vertex_desc(&self) -> &VertexDesc

Retrieve the vertex attribute this field is for

Source

pub fn vertex_attr(&self) -> VertexAttr

Retrieve the vertex attribute this field is for

Source

pub fn byte_offset(&self) -> u32

Retrieve the byte_offset within the [BufferData] for this field

Source

pub fn ele_type(&self) -> BufferElementType

Retrieve the BufferElementType of the field

Source

pub fn count(&self) -> u32

Get the count of the number of elements in the field

Source

pub fn byte_length(&self) -> u32

Get the byte length of the field

Trait Implementations§

Source§

impl<'a, R> Debug for BufferDataAccessor<'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 BufferDataAccessor<'a, R>

Source§

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

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

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

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<'a, R> Unpin for BufferDataAccessor<'a, R>
where <R as Renderable>::DataAccessor: Unpin,

§

impl<'a, R> !UnwindSafe for BufferDataAccessor<'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.