Struct Table

Source
pub struct Table<'a> { /* private fields */ }
Expand description

A wrapper class that gives direct access to the component arrays of a table, the table data

Implementations§

Source§

impl<'a> Table<'a>

Source

pub fn new(world: impl WorldProvider<'a>, table: NonNull<ecs_table_t>) -> Self

Creates a wrapper around a table

§Arguments
  • world - The world the table is in
  • table - The table to wrap
§See also
  • C++ API: table::table

Trait Implementations§

Source§

impl<'a> Clone for Table<'a>

Source§

fn clone(&self) -> Table<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Table<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl IntoTable for Table<'_>

Source§

impl IntoTableRange for Table<'_>

Source§

impl<'a> TableOperations<'a> for Table<'a>

Source§

fn count(&self) -> i32

Returns the table count

§See also
  • C++ API: table::count
Source§

fn table(&self) -> Table<'a>

Source§

fn offset(&self) -> i32

Source§

fn world(&self) -> WorldRef<'a>

Source§

fn to_string(&self) -> Option<String>

Converts table type to string Read more
Source§

fn archetype(&self) -> Archetype<'a>

Returns the type of the table Read more
Source§

fn find_type_index_id(&self, id: ecs_id_t) -> Option<i32>

Find type index for (component) id Read more
Source§

fn find_type_index<T: ComponentId>(&self) -> Option<i32>

Find type index for component type Read more
Source§

fn find_type_index_pair_ids( &self, first: impl Into<Entity>, second: impl Into<Entity>, ) -> Option<i32>

Find type index for pair of component types Read more
Source§

fn find_type_index_pair<First: ComponentId, Second: ComponentId>( &self, ) -> Option<i32>

Find type index for pair of component types Read more
Source§

fn find_type_index_second_id<First: ComponentId>( &self, second: impl Into<Entity>, ) -> Option<i32>

Find type index for pair of component types Read more
Source§

fn find_column_index_id(&self, id: ecs_id_t) -> Option<i32>

Find index for (component) id in table type Read more
Source§

fn find_column_index<T: ComponentId>(&self) -> Option<i32>

Find column index for component type in table Read more
Source§

fn find_column_index_pair<First: ComponentId, Second: ComponentId>( &self, ) -> Option<i32>

Find index for pair of component types in table Read more
Source§

fn find_column_index_pair_ids( &self, first: impl Into<Entity>, second: impl Into<Entity>, ) -> Option<i32>

Find index for pair of component ids in table type Read more
Source§

fn find_column_index_second_id<First: ComponentId>( &self, second: impl Into<Entity>, ) -> Option<i32>

Find index for pair of component types in table type Read more
Source§

fn has_type<T: ComponentId>(&self) -> bool

Test if table has component type Read more
Source§

fn has_type_id(&self, id: ecs_id_t) -> bool

Test if table has (component) id Read more
Source§

fn has_pair<First: ComponentId, Second: ComponentId>(&self) -> bool

Test if table has pair of component types Read more
Source§

fn has_pair_ids( &self, first: impl Into<Entity>, second: impl Into<Entity>, ) -> bool

Test if table has pair of component ids Read more
Source§

fn column_untyped(&self, index: i32) -> Option<*mut c_void>

Get column, components array ptr from table by column index. Read more
Source§

fn get_mut<T: ComponentId>(&self) -> Option<&mut [T]>

Get column, components array ptr from table by component type. Read more
Source§

fn get_mut_untyped(&self, id: ecs_id_t) -> Option<*mut c_void>

Get column, components array ptr from table by component type. Read more
Source§

fn get_pair_ids_mut_untyped( &self, first: impl Into<Entity>, second: impl Into<Entity>, ) -> Option<*mut c_void>

Get column, components array ptr from table by pair ids. Read more
Source§

fn get_pair_mut_untyped<First: ComponentId, Second: ComponentId>( &self, ) -> Option<*mut c_void>

Get column, components array ptr from table by pair of component types. Read more
Source§

fn column_size(&self, index: i32) -> usize

Get column size from table at the provided column index. Read more
Source§

fn depth<Rel: ComponentId>(&self) -> i32

Return depth for table in tree for relationship type. Depth is determined by counting the number of targets encountered while traversing up the relationship tree for rel. Only acyclic relationships are supported. Read more
Source§

fn depth_id(&self, rel: impl Into<Entity>) -> i32

Return depth for table in tree for relationship type. Depth is determined by counting the number of targets encountered while traversing up the relationship tree for rel. Only acyclic relationships are supported. Read more
Source§

impl<'a> Copy for Table<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Table<'a>

§

impl<'a> RefUnwindSafe for Table<'a>

§

impl<'a> !Send for Table<'a>

§

impl<'a> !Sync for Table<'a>

§

impl<'a> Unpin for Table<'a>

§

impl<'a> UnwindSafe for Table<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DoesNotImpl for T

Source§

const IMPLS: bool = false

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.