AllStoragesViewMut

Struct AllStoragesViewMut 

Source
pub struct AllStoragesViewMut<'a>(/* private fields */);
Expand description

Exclusive view over AllStorages.

Methods from Deref<Target = AllStorages>§

Source

pub fn add_unique<T: Send + Sync + Unique>(&self, component: T)

Adds a new unique storage, unique storages store exactly one T at any time.
To access a unique storage value, use UniqueView or UniqueViewMut.

§Example
use shipyard::{AllStoragesViewMut, Unique, World};

#[derive(Unique)]
struct USIZE(usize);

let world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

all_storages.add_unique(USIZE(0));
Source

pub fn add_unique_non_send<T: Sync + Unique>(&self, component: T)

Available on crate feature thread_local only.

Adds a new unique storage, unique storages store exactly one T at any time.
To access a unique storage value, use NonSend and UniqueViewMut or UniqueViewMut.
Does nothing if the storage already exists.

Source

pub fn add_unique_non_sync<T: Send + Unique>(&self, component: T)

Available on crate feature thread_local only.

Adds a new unique storage, unique storages store exactly one T at any time.
To access a unique storage value, use NonSync and UniqueViewMut or UniqueViewMut.
Does nothing if the storage already exists.

Source

pub fn add_unique_non_send_sync<T: Unique>(&self, component: T)

Available on crate feature thread_local only.

Adds a new unique storage, unique storages store exactly one T at any time.
To access a unique storage value, use NonSync and UniqueViewMut or UniqueViewMut.
Does nothing if the storage already exists.

Source

pub fn remove_unique<T: Unique>(&self) -> Result<T, UniqueRemove>

Removes a unique storage.

§Borrows
  • T storage (exclusive)
§Errors
  • T storage borrow failed.
  • T storage did not exist.
§Example
use shipyard::{AllStoragesViewMut, Unique, World};

#[derive(Unique)]
struct USIZE(usize);

let world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

all_storages.add_unique(USIZE(0));
let i = all_storages.remove_unique::<USIZE>().unwrap();
Source

pub fn delete_entity(&mut self, entity: EntityId) -> bool

Delete an entity and all its components. Returns true if entity was alive.

§Example
use shipyard::{AllStoragesViewMut, Component, Get, View, World};

#[derive(Component, Debug, PartialEq, Eq)]
struct U32(u32);

#[derive(Component, Debug, PartialEq, Eq)]
struct USIZE(usize);

let world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

let entity1 = all_storages.add_entity((USIZE(0), U32(1)));
let entity2 = all_storages.add_entity((USIZE(2), U32(3)));

all_storages.delete_entity(entity1);

all_storages.run(|usizes: View<USIZE>, u32s: View<U32>| {
    assert!((&usizes).get(entity1).is_err());
    assert!((&u32s).get(entity1).is_err());
    assert_eq!(usizes.get(entity2), Ok(&USIZE(2)));
    assert_eq!(u32s.get(entity2), Ok(&U32(3)));
});
Source

pub fn strip(&mut self, entity: EntityId)

Deletes all components from an entity without deleting it.

§Example
use shipyard::{AllStoragesViewMut, Component, World};

#[derive(Component)]
struct U32(u32);

#[derive(Component)]
struct USIZE(usize);

let world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

let entity = all_storages.add_entity((U32(0), USIZE(1)));

all_storages.strip(entity);
Source

pub fn bulk_strip<I: IntoIterator<Item = EntityId>>(&mut self, entities: I)
where I::IntoIter: Clone,

Deletes all components of multiple entities without deleting them.

§Example
use shipyard::{AllStoragesViewMut, Component, View, World};

#[derive(Component)]
struct U32(u32);

#[derive(Component)]
struct USIZE(usize);

let world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

let eid0 = all_storages.add_entity((U32(0), USIZE(1)));
let eid1 = all_storages.add_entity(USIZE(10));
let eid2 = all_storages.add_entity(U32(30));

all_storages.bulk_strip([eid0, eid1, eid2]);

let (v_u32, v_usize) = all_storages.borrow::<(View<U32>, View<USIZE>)>().unwrap();
assert_eq!(v_u32.len(), 0);
assert_eq!(v_usize.len(), 0);
Source

pub fn retain_storage<S: TupleRetainStorage>(&mut self, entity: EntityId)

Deletes all components of an entity except the ones passed in S.
The storage’s type has to be used and not the component.
SparseSet is the default storage.

§Example
use shipyard::{AllStoragesViewMut, Component, sparse_set::SparseSet, World};

#[derive(Component)]
struct U32(u32);

#[derive(Component)]
struct USIZE(usize);

let world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

let entity = all_storages.add_entity((U32(0), USIZE(1)));

all_storages.retain_storage::<SparseSet<U32>>(entity);
Source

pub fn retain_storage_by_id( &mut self, entity: EntityId, excluded_storage: &[StorageId], )

Deletes all components of an entity except the ones passed in S.
This is identical to retain_storage but uses StorageId and not generics.
You should only use this method if you use a custom storage with a runtime id.

Source

pub fn clear(&mut self)

Deletes all entities and components in the World.

§Example
use shipyard::{AllStoragesViewMut, World};

let world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

all_storages.clear();
Source

pub fn clear_all_removed_and_deleted(&mut self)

Clear all deletion and removal tracking data.

Source

pub fn clear_all_removed_and_deleted_older_than_timestamp( &mut self, timestamp: TrackingTimestamp, )

Clear all deletion and removal tracking data older than some timestamp.

Source

pub fn clear_all_inserted(&mut self)

Clear all insertion tracking data.

Source

pub fn clear_all_modified(&mut self)

Clear all modification tracking data.

Source

pub fn clear_all_inserted_and_modified(&mut self)

Clear all insertion tracking data.

Source

pub fn retain<T: Component + Send + Sync>( &mut self, f: impl FnMut(EntityId, &T) -> bool, )

Deletes all components for which f(id, &component) returns false.

§Panics
  • Storage borrow failed.
Source

pub fn retain_mut<T: Component + Send + Sync>( &mut self, f: impl FnMut(EntityId, Mut<'_, T>) -> bool, )

Deletes all components for which f(id, Mut<component>) returns false.

§Panics
  • Storage borrow failed.
Source

pub fn add_entity<T: TupleAddComponent>(&mut self, component: T) -> EntityId

Creates a new entity with the components passed as argument and returns its EntityId.
component must always be a tuple, even for a single component.

§Example
use shipyard::{AllStoragesViewMut, Component, World};

#[derive(Component)]
struct U32(u32);

#[derive(Component)]
struct USIZE(usize);

let world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

let entity0 = all_storages.add_entity((U32(0),));
let entity1 = all_storages.add_entity((U32(1), USIZE(11)));
Source

pub fn bulk_add_entity<T: BulkAddEntity>( &mut self, source: T, ) -> BulkEntityIter<'_>

Creates multiple new entities and returns an iterator yielding the new EntityIds.
source must always yield a tuple, even for a single component.

§Example
use shipyard::{AllStoragesViewMut, Component, World};

#[derive(Component)]
struct U32(u32);

#[derive(Component)]
struct USIZE(usize);

let mut world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

let new_entities = all_storages.bulk_add_entity((10..20).map(|i| (U32(i as u32), USIZE(i))));
Source

pub fn add_component<T: TupleAddComponent>( &mut self, entity: EntityId, component: T, )

Adds components to an existing entity.
If the entity already owned a component it will be replaced.
component must always be a tuple, even for a single component.

§Panics
  • entity is not alive.
§Example
use shipyard::{AllStoragesViewMut, Component, World};

#[derive(Component)]
struct U32(u32);

#[derive(Component)]
struct USIZE(usize);

let mut world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

// make an empty entity
let entity = all_storages.add_entity(());

all_storages.add_component(entity, (U32(0),));
// entity already had a `u32` component so it will be replaced
all_storages.add_component(entity, (U32(1), USIZE(11)));
Source

pub fn delete_component<C: TupleDelete>(&mut self, entity: EntityId)

Deletes components from an entity. As opposed to remove, delete doesn’t return anything.
C must always be a tuple, even for a single component.

§Example
use shipyard::{AllStoragesViewMut, Component, World};

#[derive(Component, Debug, PartialEq, Eq)]
struct U32(u32);

#[derive(Component)]
struct USIZE(usize);

let mut world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

let entity = all_storages.add_entity((U32(0), USIZE(1)));

all_storages.delete_component::<(U32,)>(entity);
Source

pub fn remove<C: TupleRemove>(&mut self, entity: EntityId) -> C::Out

Removes components from an entity.
C must always be a tuple, even for a single component.

§Example
use shipyard::{AllStoragesViewMut, Component, World};

#[derive(Component, Debug, PartialEq, Eq)]
struct U32(u32);

#[derive(Component)]
struct USIZE(usize);

let mut world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

let entity = all_storages.add_entity((U32(0), USIZE(1)));

let (i,) = all_storages.remove::<(U32,)>(entity);
assert_eq!(i, Some(U32(0)));
Source

pub fn borrow<V: Borrow>(&self) -> Result<V::View<'_>, GetStorage>

Borrows the requested storage(s), if it doesn’t exist it’ll get created.
You can use a tuple to get multiple storages at once.

You can use:

  • View<T> for a shared access to T storage
  • ViewMut<T> for an exclusive access to T storage
  • EntitiesView for a shared access to the entity storage
  • EntitiesViewMut for an exclusive reference to the entity storage
  • UniqueView<T> for a shared access to a T unique storage
  • UniqueViewMut<T> for an exclusive access to a T unique storage
  • Option<V> with one or multiple views for fallible access to one or more storages
  • This is supported on feature=“thread_local” only:
§Borrows
  • Storage (exclusive or shared)
§Errors
  • Storage borrow failed.
  • Unique storage did not exist.
§Example
use shipyard::{AllStoragesViewMut, Component, EntitiesView, View, ViewMut, World};

#[derive(Component)]
struct U32(u32);

#[derive(Component)]
struct USIZE(usize);

let world = World::new();

let all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

let u32s = all_storages.borrow::<View<U32>>().unwrap();
let (entities, mut usizes) = all_storages
    .borrow::<(EntitiesView, ViewMut<USIZE>)>()
    .unwrap();
Source

pub fn run_with_data<Data, B, S: AllSystem<(Data,), B>>( &self, system: S, data: Data, ) -> S::Return

Borrows the requested storages, runs the function and evaluates to the function’s return value.
Data can be passed to the function, this always has to be a single type but you can use a tuple if needed.

You can use:

  • View<T> for a shared access to T storage
  • ViewMut<T> for an exclusive access to T storage
  • EntitiesView for a shared access to the entity storage
  • EntitiesViewMut for an exclusive reference to the entity storage
  • UniqueView<T> for a shared access to a T unique storage
  • UniqueViewMut<T> for an exclusive access to a T unique storage
  • Option<V> with one or multiple views for fallible access to one or more storages
  • This is supported on feature=“thread_local” only:
§Borrows
  • Storage (exclusive or shared)
§Panics
  • Storage borrow failed.
  • Unique storage did not exist.
  • Error returned by user.
Source

pub fn run<B, S: AllSystem<(), B>>(&self, system: S) -> S::Return

Borrows the requested storages, runs the function and evaluates to the function’s return value.

You can use:

  • View<T> for a shared access to T storage
  • ViewMut<T> for an exclusive access to T storage
  • EntitiesView for a shared access to the entity storage
  • EntitiesViewMut for an exclusive reference to the entity storage
  • UniqueView<T> for a shared access to a T unique storage
  • UniqueViewMut<T> for an exclusive access to a T unique storage
  • Option<V> with one or multiple views for fallible access to one or more storages
  • This is supported on feature=“thread_local” only:
§Borrows
  • Storage (exclusive or shared)
§Panics
  • Storage borrow failed.
  • Unique storage did not exist.
  • Error returned by user.
§Example
use shipyard::{AllStoragesViewMut, Component, View, ViewMut, World};

#[derive(Component)]
struct I32(i32);

#[derive(Component)]
struct U32(u32);

#[derive(Component)]
struct USIZE(usize);

fn sys1(i32s: View<I32>) -> i32 {
    0
}

let world = World::new();

let all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

all_storages
    .run(|usizes: View<USIZE>, mut u32s: ViewMut<U32>| {
        // -- snip --
    });

let i = all_storages.run(sys1);
Source

pub fn delete_any<T: TupleDeleteAny>(&mut self)

Deletes any entity with at least one of the given type(s).
The storage’s type has to be used and not the component.
SparseSet is the default storage.

§Example
use shipyard::{AllStoragesViewMut, Component, sparse_set::SparseSet, World};

#[derive(Component)]
struct U32(u32);

#[derive(Component)]
struct USIZE(usize);

#[derive(Component)]
struct STR(&'static str);

let world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

let entity0 = all_storages.add_entity((U32(0),));
let entity1 = all_storages.add_entity((USIZE(1),));
let entity2 = all_storages.add_entity((STR("2"),));

// deletes `entity2`
all_storages.delete_any::<SparseSet<STR>>();
// deletes `entity0` and `entity1`
all_storages.delete_any::<(SparseSet<U32>, SparseSet<USIZE>)>();
Source

pub fn spawn(&mut self, entity: EntityId) -> bool

Make the given entity alive.
Does nothing if an entity with a greater generation is already at this index.
Returns true if the entity is successfully spawned.

Source

pub fn memory_usage(&self) -> AllStoragesMemoryUsage<'_>

Displays storages memory information.

Source

pub fn get_tracking_timestamp(&self) -> TrackingTimestamp

Returns a timestamp used to clear tracking information.

Source

pub fn track_insertion<T: TupleTrack>(&mut self) -> &mut AllStorages

Enable insertion tracking for the given components.

Source

pub fn track_modification<T: TupleTrack>(&mut self) -> &mut AllStorages

Enable modification tracking for the given components.

Source

pub fn track_deletion<T: TupleTrack>(&mut self) -> &mut AllStorages

Enable deletion tracking for the given components.

Source

pub fn track_removal<T: TupleTrack>(&mut self) -> &mut AllStorages

Enable removal tracking for the given components.

Source

pub fn track_all<T: TupleTrack>(&mut self)

Enable insertion, deletion and removal tracking for the given components.

Source

pub fn get<T: GetComponent>( &self, entity: EntityId, ) -> Result<T::Out<'_>, GetComponent>

Retrieve components of entity.

Multiple components can be queried at the same time using a tuple.

You can use:

  • &T for a shared access to T component
  • &mut T for an exclusive access to T component
  • This is supported on feature=“thread_local” only:
  • NonSend<&T> for a shared access to a T component where T isn’t Send
  • NonSend<&mut T> for an exclusive access to a T component where T isn’t Send
  • NonSync<&T> for a shared access to a T component where T isn’t Sync
  • NonSync<&mut T> for an exclusive access to a T component where T isn’t Sync
  • NonSendSync<&T> for a shared access to a T component where T isn’t Send nor Sync
  • NonSendSync<&mut T> for an exclusive access to a T component where T isn’t Send nor Sync
§Borrows
§Errors
  • AllStorages borrow failed.
  • Storage borrow failed.
  • Entity does not have the component.
§Example
use shipyard::{AllStoragesViewMut, Component, World};

#[derive(Component, Debug, PartialEq, Eq)]
struct U32(u32);

#[derive(Component, Debug, PartialEq, Eq)]
struct USIZE(usize);

let world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

let entity = all_storages.add_entity((USIZE(0), U32(1)));

let (i, j) = all_storages.get::<(&USIZE, &mut U32)>(entity).unwrap();

assert!(*i == &USIZE(0));
assert!(*j == &U32(1));
Source

pub fn get_unique<T: GetUnique>(&self) -> Result<T::Out<'_>, GetStorage>

Retrieve a unique component.

You can use:

  • &T for a shared access to T unique component
  • &mut T for an exclusive access to T unique component
  • This is supported on feature=“thread_local” only:
  • NonSend<&T> for a shared access to a T unique component where T isn’t Send
  • NonSend<&mut T> for an exclusive access to a T unique component where T isn’t Send
  • NonSync<&T> for a shared access to a T unique component where T isn’t Sync
  • NonSync<&mut T> for an exclusive access to a T unique component where T isn’t Sync
  • NonSendSync<&T> for a shared access to a T unique component where T isn’t Send nor Sync
  • NonSendSync<&mut T> for an exclusive access to a T unique component where T isn’t Send nor Sync
§Borrows
§Errors
§Example
use shipyard::{AllStoragesViewMut, Unique, World};

#[derive(Unique, Debug, PartialEq, Eq)]
struct U32(u32);

let world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

all_storages.add_unique(U32(0));

let i = all_storages.get_unique::<&U32>().unwrap();

assert!(*i == U32(0));
Source

pub fn iter<'a, T: IterComponent>(&'a self) -> IntoIterRef<'a, T>

Iterate components.

Multiple components can be iterated at the same time using a tuple.

You can use:

  • &T for a shared access to T component
  • &mut T for an exclusive access to T component
  • This is supported on feature=“thread_local” only:
  • NonSend<&T> for a shared access to a T component where T isn’t Send
  • NonSend<&mut T> for an exclusive access to a T component where T isn’t Send
  • NonSync<&T> for a shared access to a T component where T isn’t Sync
  • NonSync<&mut T> for an exclusive access to a T component where T isn’t Sync
  • NonSendSync<&T> for a shared access to a T component where T isn’t Send nor Sync
  • NonSendSync<&mut T> for an exclusive access to a T component where T isn’t Send nor Sync
§Borrows
§Panics
§Example
use shipyard::{AllStoragesViewMut, Component, World};

#[derive(Component, Debug, PartialEq, Eq)]
struct U32(u32);

#[derive(Component, Debug, PartialEq, Eq)]
struct USIZE(usize);

let world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

let entity = all_storages.add_entity((USIZE(0), U32(1)));

let mut iter = all_storages.iter::<(&USIZE, &mut U32)>();

for (i, j) in &mut iter {
    // <-- SNIP -->
}
Source

pub fn on_deletion(&self, f: impl FnMut(EntityId) + Send + Sync + 'static)

Sets the on entity deletion callback.

§Borrows
  • Entities (exclusive)
§Panics
  • Entities borrow failed.
Source

pub fn is_entity_alive(&mut self, entity: EntityId) -> bool

Returns true if entity matches a living entity.

Source

pub fn move_entity(&mut self, other: &mut AllStorages, entity: EntityId)

Moves an entity from a World to another.

§Panics
  • entity is not alive
use shipyard::{AllStoragesViewMut, Component, World};

#[derive(Component, Debug, PartialEq, Eq)]
struct USIZE(usize);

let world1 = World::new();
let world2 = World::new();

let mut all_storages1 = world1.borrow::<AllStoragesViewMut>().unwrap();
let mut all_storages2 = world2.borrow::<AllStoragesViewMut>().unwrap();

let entity = all_storages1.add_entity(USIZE(1));

all_storages1.move_entity(&mut all_storages2, entity);

assert!(!all_storages1.is_entity_alive(entity));
assert_eq!(all_storages2.get::<&USIZE>(entity).as_deref(), Ok(&&USIZE(1)));
Source

pub fn move_components( &mut self, other: &mut AllStorages, from: EntityId, to: EntityId, )

Moves all components from an entity to another in another World.

§Panics
  • from is not alive
  • to is not alive
use shipyard::{AllStoragesViewMut, Component, World};

#[derive(Component, Debug, PartialEq, Eq)]
struct USIZE(usize);

let world1 = World::new();
let world2 = World::new();

let mut all_storages1 = world1.borrow::<AllStoragesViewMut>().unwrap();
let mut all_storages2 = world2.borrow::<AllStoragesViewMut>().unwrap();

let from = all_storages1.add_entity(USIZE(1));
let to = all_storages2.add_entity(());

all_storages1.move_components(&mut all_storages2, from, to);

assert!(all_storages1.get::<&USIZE>(from).is_err());
assert_eq!(all_storages2.get::<&USIZE>(to).as_deref(), Ok(&&USIZE(1)));
Source

pub fn register_clone<T: TupleClone>(&mut self)

Registers the function to clone these components.

Source

pub fn clone_storages_to(&self, other: &mut AllStorages)

Clones all storages with a registered clone function from this AllStorages to other.

Tracking is not cloned. Components will count as inserted in other.

Source

pub fn clone_entity_to( &self, other_all_storages: &mut AllStorages, entity: EntityId, )

Clones entity from this AllStorages to other_all_storages alongside all its with a registered clone function.

Source

pub fn clone_components_to( &self, other_all_storages: &mut AllStorages, from: EntityId, to: EntityId, )

Clones all components of from entity with a registered clone function from this AllStorages to other_all_storages’s to entity.

Source

pub fn serialize<'a, S: Serializer, V: Borrow>( &'a self, serializer: S, ) -> Result<S::Ok, Serialize<S>>
where V::View<'a>: Serialize,

Available on crate feature serde1 only.

Serializes the view using the provided serializer.

§Example
use shipyard::{AllStoragesViewMut, Component, View, World};

#[derive(Component, serde::Serialize)]
struct Name(String);

let world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

let eid1 = all_storages.add_entity(Name("Alice".to_string()));

let mut serialized = Vec::new();
all_storages
    .serialize::<_, View<Name>>(&mut serde_json::ser::Serializer::new(&mut serialized))
    .unwrap_or_else(|_| panic!());

let serialized_str = String::from_utf8(serialized).unwrap();
assert_eq!(serialized_str, r#"[[{"index":0,"gen":0},"Alice"]]"#);
Source

pub fn deserialize<'a, 'de, D: Deserializer<'de>, V: Borrow>( &'a self, deserializer: D, ) -> Result<(), Deserialize<'de, D>>
where V::View<'a>: Deserialize<'de>,

Available on crate feature serde1 only.

Deserializes the view using the provided deserializer.

§Example
use shipyard::{AllStoragesViewMut, Component, EntityId, ViewMut, World};

#[derive(Component, serde::Deserialize)]
struct Name(String);

let world = World::new();
let mut all_storages = world.borrow::<AllStoragesViewMut>().unwrap();

let mut serialized = r#"[[{"index":0,"gen":0},"Alice"]]"#;
all_storages
    .deserialize::<_, ViewMut<Name>>(&mut serde_json::de::Deserializer::from_str(serialized))
    .unwrap_or_else(|_| panic!());

let alice_eid = EntityId::new_from_index_and_gen(0, 0);
assert_eq!(all_storages.get::<&Name>(alice_eid).unwrap().0, "Alice");

// Careful here, the World is not in a stable state

assert_eq!(all_storages.is_entity_alive(alice_eid), false);

// We can use World::spawn for example to fix the problem
// another solution would be to serialize EntitiesViewMut

all_storages.spawn(alice_eid);

assert_eq!(all_storages.is_entity_alive(alice_eid), true);

Trait Implementations§

Source§

impl AsMut<AllStorages> for AllStoragesViewMut<'_>

Source§

fn as_mut(&mut self) -> &mut AllStorages

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<AllStorages> for AllStoragesViewMut<'_>

Source§

fn as_ref(&self) -> &AllStorages

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'a> BorrowInfo for AllStoragesViewMut<'a>

Source§

fn borrow_info(info: &mut Vec<TypeInfo>)

This information is used during workload creation to determine which systems can run in parallel. Read more
Source§

fn enable_tracking(_: &mut Vec<fn(&AllStorages) -> Result<(), GetStorage>>)

Enable tracking on the World where this storage is borrowed.
Source§

impl Deref for AllStoragesViewMut<'_>

Source§

type Target = AllStorages

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for AllStoragesViewMut<'_>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl WorldBorrow for AllStoragesViewMut<'_>

Source§

type WorldView<'a> = AllStoragesViewMut<'a>

Source§

fn world_borrow( world: &World, _last_run: Option<TrackingTimestamp>, _current: TrackingTimestamp, ) -> Result<Self::WorldView<'_>, GetStorage>

This function is where the actual borrowing happens.

Auto Trait Implementations§

§

impl<'a> Freeze for AllStoragesViewMut<'a>

§

impl<'a> !RefUnwindSafe for AllStoragesViewMut<'a>

§

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

§

impl<'a> Sync for AllStoragesViewMut<'a>

§

impl<'a> Unpin for AllStoragesViewMut<'a>

§

impl<'a> !UnwindSafe for AllStoragesViewMut<'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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more