[][src]Struct crystal_engine::state::FixedVec

pub struct FixedVec<T> { /* fields omitted */ }

A fixed vec of light sources. This is limited to 100 entries because of a limitation in the way Crystal's shaders are implemented. Please open an issue if you need more light sources.

This should mirror most functions that exist on Vec. If you're missing a function, feel free to open an issue or PR!

Implementations

impl<T> FixedVec<T>[src]

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

Extracts a slice containing the entire fixed vec.

Equivalent to &s[..].

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

Extracts a mutable slice of the entire fixed vec.

Equivalent to &mut s[..].

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

Get the amount of lights that are stored in this FixedVec.

Note: this is always 100 or lower.

pub fn is_empty(&self) -> bool[src]

Returns true if this FixedVec is empty.

This is an alias for self.len() == 0

pub fn push(&mut self, t: T)[src]

Add a new light to this FixedVec.

This will panic if more than 100 lights are added.

pub fn pop(&mut self)[src]

Remove the last light source from this FixedVec.

This will panic if the FixedVec is empty.

Trait Implementations

impl<T> Index<usize> for FixedVec<T>[src]

type Output = T

The returned type after indexing.

impl<T> IndexMut<usize> for FixedVec<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for FixedVec<T> where
    T: RefUnwindSafe

impl<T> Send for FixedVec<T> where
    T: Send

impl<T> Sync for FixedVec<T> where
    T: Sync

impl<T> Unpin for FixedVec<T> where
    T: Unpin

impl<T> UnwindSafe for FixedVec<T> where
    T: UnwindSafe

Blanket Implementations

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

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

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

impl<T> Content for T[src]

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

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

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

impl<T> SetParameter for T

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.

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.