pub struct VertexStream<V: Pod, B> { /* private fields */ }

Implementations§

source§

impl<V: Pod, B> VertexStream<V, B>

source

pub fn new(resize_count: usize) -> Self

source

pub fn fork(&self) -> Self

source

pub fn token(&self) -> VertexStreamToken

source

pub unsafe fn extract(&mut self, token: VertexStreamToken) -> Self

§Safety

By extracting part of stream, you might make this and new stream invalid!

source

pub fn transformed( &mut self, f: impl FnMut(&mut Self), t: impl FnMut(&mut V) ) -> &mut Self

source

pub fn triangle(&mut self, vertices: [V; 3]) -> &mut Self

source

pub fn triangle_fan( &mut self, vertices: impl IntoIterator<Item = V> ) -> &mut Self

source

pub fn triangle_strip( &mut self, vertices: impl IntoIterator<Item = V> ) -> &mut Self

source

pub fn quad(&mut self, vertices: [V; 4]) -> &mut Self

source

pub fn extend( &mut self, vertices: impl IntoIterator<Item = V>, triangles: impl IntoIterator<Item = Triangle> ) -> &mut Self

source

pub unsafe fn extend_vertices( &mut self, iter: impl IntoIterator<Item = V> ) -> &Self

§Safety

By writing raw vertices you might produce invalid renderables!

source

pub unsafe fn extend_triangles( &mut self, relative: bool, iter: impl IntoIterator<Item = Triangle> ) -> &Self

§Safety

By writing raw triangles you might produce invalid renderables!

source

pub unsafe fn extend_batches( &mut self, iter: impl IntoIterator<Item = (B, Range<usize>)> ) -> &Self

§Safety

By writing raw batches you might produce invalid renderables!

source

pub fn append(&mut self, other: &mut Self)

source

pub fn append_cloned(&mut self, other: &Self)
where B: Clone,

source

pub fn clear(&mut self)

source

pub fn batch(&mut self, data: B)

source

pub fn batch_optimized(&mut self, data: B)
where B: PartialEq,

source

pub fn batch_end(&mut self)

source

pub fn render<R: VertexStreamRenderer<V, B>>( &mut self, renderer: &mut R ) -> Result<(), R::Error>

source

pub fn vertices(&self) -> &[V]

source

pub fn triangles(&self) -> &[Triangle]

source

pub fn batches(&self) -> &[(B, Range<usize>)]

source

pub fn drain( &mut self ) -> (Drain<'_, V>, Drain<'_, Triangle>, Drain<'_, (B, Range<usize>)>)

Trait Implementations§

source§

impl<V: Pod, B> Default for VertexStream<V, B>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<V, B> RefUnwindSafe for VertexStream<V, B>

§

impl<V, B> Send for VertexStream<V, B>
where B: Send, V: Send,

§

impl<V, B> Sync for VertexStream<V, B>
where B: Sync, V: Sync,

§

impl<V, B> Unpin for VertexStream<V, B>
where B: Unpin, V: Unpin,

§

impl<V, B> UnwindSafe for VertexStream<V, B>
where B: UnwindSafe, V: UnwindSafe,

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<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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.