pub struct ComponentDescriptor {
pub component_type_id: ComponentTypeId,
pub size: u16,
pub align: u16,
pub fns: ComponentDescriptorFnPointers,
}
Expand description
Fields
component_type_id: ComponentTypeId
size: u16
align: u16
fns: ComponentDescriptorFnPointers
Implementations
sourceimpl ComponentDescriptor
impl ComponentDescriptor
sourcepub const INVALID: Self = _
pub const INVALID: Self = _
Represents an invalid component descriptor. This descriptor must not be used as a valid descriptor.
sourcepub fn new(
component_type_id: ComponentTypeId,
size: u16,
align: u16,
drop_handler: unsafe fn(ptr: *mut u8, len: usize)
) -> Self
pub fn new(
component_type_id: ComponentTypeId,
size: u16,
align: u16,
drop_handler: unsafe fn(ptr: *mut u8, len: usize)
) -> Self
Creates a new component descriptor from the provided arguments.
Returns ComponentDescriptor::INVALID
if a valid descriptor cannot be constructed.
sourcepub unsafe fn drop_handler_wrapper<C: Component>(ptr: *mut u8, len: usize)
pub unsafe fn drop_handler_wrapper<C: Component>(ptr: *mut u8, len: usize)
Do not use this manually. It wraps a type erased drop handler.
Safety
The pointer must be properly aligned to an instance of C and the len must be valid for the slice.
sourcepub const fn component_type_id(&self) -> ComponentTypeId
pub const fn component_type_id(&self) -> ComponentTypeId
Get a the component descriptor’s component type id.
Trait Implementations
sourceimpl Clone for ComponentDescriptor
impl Clone for ComponentDescriptor
sourcefn clone(&self) -> ComponentDescriptor
fn clone(&self) -> ComponentDescriptor
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for ComponentDescriptor
impl Debug for ComponentDescriptor
sourceimpl Into<ArchetypeDescriptor> for &ComponentDescriptor
impl Into<ArchetypeDescriptor> for &ComponentDescriptor
sourcefn into(self) -> ArchetypeDescriptor
fn into(self) -> ArchetypeDescriptor
Converts this type into the (usually inferred) input type.
sourceimpl Into<ArchetypeDescriptor> for ComponentDescriptor
impl Into<ArchetypeDescriptor> for ComponentDescriptor
sourcefn into(self) -> ArchetypeDescriptor
fn into(self) -> ArchetypeDescriptor
Converts this type into the (usually inferred) input type.
sourceimpl PartialEq<ComponentDescriptor> for ComponentDescriptor
impl PartialEq<ComponentDescriptor> for ComponentDescriptor
sourcefn eq(&self, other: &ComponentDescriptor) -> bool
fn eq(&self, other: &ComponentDescriptor) -> bool
impl StructuralPartialEq for ComponentDescriptor
Auto Trait Implementations
impl RefUnwindSafe for ComponentDescriptor
impl Send for ComponentDescriptor
impl Sync for ComponentDescriptor
impl Unpin for ComponentDescriptor
impl UnwindSafe for ComponentDescriptor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more