Struct rust_gl::binder::Binder[][src]

pub struct Binder<'target, 'buffer, const TARGET: u32> {
    pub target: &'target mut Target<WebGl2RenderingContext, TARGET>,
    pub buffer: &'buffer mut WebGlBuffer,
}
Expand description

Mutably binds a buffer to a target.

Fields

target: &'target mut Target<WebGl2RenderingContext, TARGET>
Expand description

A mutable reference to the given target, this ensures that as long as this object exists, no other object can use the given target.

buffer: &'buffer mut WebGlBuffer
Expand description

A mutable reference to the given buffer, this ensures that as long as this object exists, no other object can use the given buffer.

Implementations

impl<'target, 'buffer> Binder<'target, 'buffer, { WebGl2RenderingContext::ARRAY_BUFFER }>[src]

pub fn pointer<'attribute, 'pointer, T>(
    &mut self,
    pointer: &'attribute mut AttributePointer<'pointer, T>
) -> BoundPointer<'attribute, 'pointer, T> where
    T: GLType
[src]

Binds the attribute pointer to a given buffer.

impl<'target, 'buffer, const TARGET: u32> Binder<'target, 'buffer, TARGET>[src]

pub fn sub<'binder, T>(
    &'binder mut self,
    range: T
) -> Sub<'binder, 'target, 'buffer, TARGET> where
    T: RangeBounds<i32>, 
[src]

Create a sub access buffer.

impl<'target, 'buffer, const TARGET: u32> Binder<'target, 'buffer, TARGET>[src]

pub fn len(&mut self) -> usize[src]

The length of the buffer in bytes.

Trait Implementations

impl<'a, 'target, 'buffer, const TARGET: u32> Allocate<&'a [u8]> for Binder<'target, 'buffer, TARGET>[src]

Allocate the opengl buffer, and copy the slice to the buffer.

type Error = Error

fn allocate(&mut self, src: &'a [u8], usage: u32) -> Result<&mut Self, Error>[src]

impl<'a, 'target, 'target2, 'buffer, 'buffer2, const TARGET: u32, const TARGET2: u32> Allocate<&'a mut Binder<'target2, 'buffer2, TARGET2>> for Binder<'target, 'buffer, TARGET>[src]

Allocate of a buffer of the same size as the input buffer and copy the contents of the input buffer to it.

type Error = Box<dyn Error>

fn allocate(
    &mut self,
    src: &'a mut Binder<'target2, 'buffer2, TARGET2>,
    usage: u32
) -> Result<&mut Self, Box<dyn Error>>
[src]

impl<'target, 'buffer, const TARGET: u32> Allocate<i32> for Binder<'target, 'buffer, TARGET>[src]

Allocate the opengl buffer of the specified size.

type Error = Error

fn allocate(&mut self, src: i32, usage: u32) -> Result<&mut Self, Error>[src]

Auto Trait Implementations

impl<'target, 'buffer, const TARGET: u32> !RefUnwindSafe for Binder<'target, 'buffer, TARGET>

impl<'target, 'buffer, const TARGET: u32> !Send for Binder<'target, 'buffer, TARGET>

impl<'target, 'buffer, const TARGET: u32> !Sync for Binder<'target, 'buffer, TARGET>

impl<'target, 'buffer, const TARGET: u32> Unpin for Binder<'target, 'buffer, TARGET>

impl<'target, 'buffer, const TARGET: u32> !UnwindSafe for Binder<'target, 'buffer, TARGET>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.