Struct ArchetypeUnsafeFfi
pub struct ArchetypeUnsafeFfi { /* private fields */ }Implementations§
§impl ArchetypeUnsafeFfi
impl ArchetypeUnsafeFfi
pub fn new( types: TypesRegistryAccessFfi, components_set: UniqueComponentsSet, ) -> ArchetypeUnsafeFfi
pub fn contains_component_type(&self, type_id: u64) -> bool
pub fn iter<'a>(&'a self) -> ArchetypeUnsafeFfiIterator<'a> ⓘ
pub fn entities_count(&self) -> u64
pub fn get_entity(&self, entity_index: u64) -> Option<EntityId>
pub fn get_component_ptr( &self, entity_index: u64, component_id: u64, ) -> Option<*mut u8>
pub fn create_entity(&mut self, entity: EntityId)
pub fn destroy_entity(&mut self, entity_index: u64) -> Option<EntityId>
pub fn destroy_entity(&mut self, entity_index: u64) -> Option<EntityId>
Returns the last entity before the destroy.
pub unsafe fn add_component(
src: &mut ArchetypeUnsafeFfi,
dst: &mut ArchetypeUnsafeFfi,
src_entity_index: u64,
component_ptr: *mut u8,
component_id: u64,
) -> Option<EntityId>
pub unsafe fn add_component( src: &mut ArchetypeUnsafeFfi, dst: &mut ArchetypeUnsafeFfi, src_entity_index: u64, component_ptr: *mut u8, component_id: u64, ) -> Option<EntityId>
Returns the last entity from src archetype before the movement.
§Safety
Memory is automatically deallocated. Needs manual lifetime-management.
pub unsafe fn replace_components( &mut self, entity_index: u64, components: &[ComponentPtr], ) -> bool
pub unsafe fn set_components( src: &mut ArchetypeUnsafeFfi, dst: &mut ArchetypeUnsafeFfi, src_entity_index: u64, components: &[ComponentPtr], ) -> Option<EntityId>
pub unsafe fn remove_component(
src: &mut ArchetypeUnsafeFfi,
dst: &mut ArchetypeUnsafeFfi,
src_entity_index: u64,
component_mover: impl FnOnce(*mut u8, &'static FfiExtendedTypeInfo),
component_id: u64,
) -> Option<EntityId>
pub unsafe fn remove_component( src: &mut ArchetypeUnsafeFfi, dst: &mut ArchetypeUnsafeFfi, src_entity_index: u64, component_mover: impl FnOnce(*mut u8, &'static FfiExtendedTypeInfo), component_id: u64, ) -> Option<EntityId>
Returns the last entity from src archetype before the movement.
pub fn layout(&self) -> &ArchetypeLayout
pub unsafe fn raw_archetype(&self) -> &ArchetypeRaw
Auto Trait Implementations§
impl Forget for ArchetypeUnsafeFfi
impl Freeze for ArchetypeUnsafeFfi
impl Move for ArchetypeUnsafeFfi
impl RefUnwindSafe for ArchetypeUnsafeFfi
impl Send for ArchetypeUnsafeFfi
impl Sync for ArchetypeUnsafeFfi
impl Unpin for ArchetypeUnsafeFfi
impl UnsafeUnpin for ArchetypeUnsafeFfi
impl UnwindSafe for ArchetypeUnsafeFfi
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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> ⓘ
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