spitfire_core

Struct VertexStream

Source
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> Freeze for VertexStream<V, B>

§

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

§

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

§

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

§

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

§

impl<V, B> UnwindSafe for VertexStream<V, B>
where V: UnwindSafe, B: 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>,

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.