#[repr(align(64))]pub struct ComponentResourceSet { /* private fields */ }Expand description
Provides raw access to component data slices.
Implementations§
Source§impl ComponentResourceSet
impl ComponentResourceSet
Sourcepub unsafe fn data_raw(&self) -> (Ref<'_, *mut u8>, usize, usize)
pub unsafe fn data_raw(&self) -> (Ref<'_, *mut u8>, usize, usize)
Gets a raw pointer to the start of the component slice.
Returns a tuple containing (pointer, element_size, count).
§Safety
Access to the component data within the slice is runtime borrow checked in debug builds. This call will panic if borrowing rules are broken in debug, and is undefined behavior in release.
Sourcepub unsafe fn data_raw_mut(&self) -> (RefMut<'_, *mut u8>, usize, usize)
pub unsafe fn data_raw_mut(&self) -> (RefMut<'_, *mut u8>, usize, usize)
Gets a raw pointer to the start of the component slice.
Returns a tuple containing (pointer, element_size, count).
§Safety
Access to the component data within the slice is runtime borrow checked in debug builds. This call will panic if borrowing rules are broken in debug, and is undefined behavior in release.
§Panics
Will panic when an internal u64 counter overflows. It will happen in 50000 years if you do 10000 mutations a millisecond.
Sourcepub unsafe fn data_slice<T>(&self) -> RefMap<'_, &[T]>
pub unsafe fn data_slice<T>(&self) -> RefMap<'_, &[T]>
Gets a shared reference to the slice of components.
§Safety
Ensure that T is representative of the component data actually stored.
Access to the component data within the slice is runtime borrow checked. This call will panic if borrowing rules are broken.
Sourcepub unsafe fn data_slice_mut<T>(&self) -> RefMapMut<'_, &mut [T]>
pub unsafe fn data_slice_mut<T>(&self) -> RefMapMut<'_, &mut [T]>
Gets a mutable reference to the slice of components.
§Safety
Ensure that T is representative of the component data actually stored.
Access to the component data within the slice is runtime borrow checked. This call will panic if borrowing rules are broken.
§Panics
Will panic when an internal u64 counter overflows. It will happen in 50000 years if you do 10000 mutations a millisecond.
Sourcepub fn writer(&mut self) -> ComponentWriter<'_>
pub fn writer(&mut self) -> ComponentWriter<'_>
Creates a writer for pushing components into or removing from the vec.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ComponentResourceSet
impl !RefUnwindSafe for ComponentResourceSet
impl !Send for ComponentResourceSet
impl !Sync for ComponentResourceSet
impl Unpin for ComponentResourceSet
impl UnwindSafe for ComponentResourceSet
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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