pub struct Attributes<'a>(/* private fields */);Expand description
Checked borrowed attribute view with at most 32 components per vertex.
Implementations§
Source§impl<'a> Attributes<'a>
impl<'a> Attributes<'a>
Sourcepub fn from_interleaved(
data: &'a [f32],
count: usize,
components: usize,
stride: usize,
offset: usize,
) -> Result<Self, Error>
pub fn from_interleaved( data: &'a [f32], count: usize, components: usize, stride: usize, offset: usize, ) -> Result<Self, Error>
Borrow interleaved attributes; stride and offset are in f32 elements. Zero components are supported; stride is at most 64 elements.
§Errors
InvalidLayout for an unsupported width, stride, offset or buffer length;
SizeOverflow if view size arithmetic overflows.
Sourcepub fn from_bytes(
data: &'a [u8],
count: usize,
components: usize,
stride: usize,
offset: usize,
order: ByteOrder,
) -> Result<Self, Error>
pub fn from_bytes( data: &'a [u8], count: usize, components: usize, stride: usize, offset: usize, order: ByteOrder, ) -> Result<Self, Error>
Borrow initialized attribute bytes with an explicit byte order. Byte stride is a multiple of four and at most 256 bytes.
§Errors
InvalidLayout for an unsupported width, stride, offset or buffer length;
SizeOverflow if view size arithmetic overflows.
Sourcepub const fn components(self) -> usize
pub const fn components(self) -> usize
Components per vertex.
Trait Implementations§
Source§impl<'a> Clone for Attributes<'a>
impl<'a> Clone for Attributes<'a>
impl<'a> Copy for Attributes<'a>
Auto Trait Implementations§
impl<'a> Freeze for Attributes<'a>
impl<'a> RefUnwindSafe for Attributes<'a>
impl<'a> Send for Attributes<'a>
impl<'a> Sync for Attributes<'a>
impl<'a> Unpin for Attributes<'a>
impl<'a> UnsafeUnpin for Attributes<'a>
impl<'a> UnwindSafe for Attributes<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more