NonSendSync

Struct NonSendSync 

Source
pub struct NonSendSync<T: ?Sized>(/* private fields */);
Available on crate feature thread_local only.
Expand description

Type used to access !Send + !Sync storages.

Trait Implementations§

Source§

impl<T: ?Sized> AsMut<T> for NonSendSync<T>

Source§

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

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

impl<T: ?Sized> AsRef<T> for NonSendSync<T>

Source§

fn as_ref(&self) -> &T

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

impl<T: Unique> Borrow for NonSendSync<UniqueView<'_, T>>

Source§

type View<'a> = NonSendSync<UniqueView<'a, T>>

Source§

fn borrow<'a>( all_storages: &'a AllStorages, all_borrow: Option<SharedBorrow<'a>>, last_run: Option<TrackingTimestamp>, current: TrackingTimestamp, ) -> Result<Self::View<'a>, GetStorage>

This function is where the actual borrowing happens.
Source§

impl<T: Unique> Borrow for NonSendSync<UniqueViewMut<'_, T>>

Source§

type View<'a> = NonSendSync<UniqueViewMut<'a, T>>

Source§

fn borrow<'a>( all_storages: &'a AllStorages, all_borrow: Option<SharedBorrow<'a>>, last_run: Option<TrackingTimestamp>, current: TrackingTimestamp, ) -> Result<Self::View<'a>, GetStorage>

This function is where the actual borrowing happens.
Source§

impl<T: Component, Track> Borrow for NonSendSync<View<'_, T, Track>>
where Track: Tracking,

Source§

type View<'a> = NonSendSync<View<'a, T, Track>>

Source§

fn borrow<'a>( all_storages: &'a AllStorages, all_borrow: Option<SharedBorrow<'a>>, last_run: Option<TrackingTimestamp>, current: TrackingTimestamp, ) -> Result<Self::View<'a>, GetStorage>

This function is where the actual borrowing happens.
Source§

impl<T: Component, Track> Borrow for NonSendSync<ViewMut<'_, T, Track>>
where Track: Tracking,

Source§

type View<'a> = NonSendSync<ViewMut<'a, T, Track>>

Source§

fn borrow<'a>( all_storages: &'a AllStorages, all_borrow: Option<SharedBorrow<'a>>, last_run: Option<TrackingTimestamp>, current: TrackingTimestamp, ) -> Result<Self::View<'a>, GetStorage>

This function is where the actual borrowing happens.
Source§

impl<'a, T: Unique> BorrowInfo for NonSendSync<UniqueView<'a, T>>

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<'a, T: Unique> BorrowInfo for NonSendSync<UniqueViewMut<'a, T>>

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<'a, T: Component, Track> BorrowInfo for NonSendSync<View<'a, T, Track>>
where Track: Tracking,

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( enable_tracking_fn: &mut Vec<fn(&AllStorages) -> Result<(), GetStorage>>, )

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

impl<'a, T: Component, Track> BorrowInfo for NonSendSync<ViewMut<'a, T, Track>>
where Track: Tracking,

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( enable_tracking_fn: &mut Vec<fn(&AllStorages) -> Result<(), GetStorage>>, )

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

impl<T: ?Sized> Deref for NonSendSync<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl<T: ?Sized> DerefMut for NonSendSync<T>

Source§

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

Mutably dereferences the value.
Source§

impl<T: Component> GetComponent for NonSendSync<&T>

Source§

type Out<'a> = Ref<'a, &'a T>

Source§

fn get<'a>( all_storages: &'a AllStorages, all_borrow: Option<SharedBorrow<'a>>, _current: TrackingTimestamp, entity: EntityId, ) -> Result<Self::Out<'a>, GetComponent>

Source§

impl<T: Component> GetComponent for NonSendSync<&mut T>

Source§

type Out<'a> = RefMut<'a, &'a mut T>

Source§

fn get<'a>( all_storages: &'a AllStorages, all_borrow: Option<SharedBorrow<'a>>, current: TrackingTimestamp, entity: EntityId, ) -> Result<Self::Out<'a>, GetComponent>

Source§

impl<T: Unique> GetUnique for NonSendSync<&T>

Source§

type Out<'a> = NonSendSync<UniqueView<'a, T>>

Source§

fn get_unique<'a>( all_storages: &'a AllStorages, all_borrow: Option<SharedBorrow<'a>>, ) -> Result<Self::Out<'a>, GetStorage>

Source§

impl<T: Unique> GetUnique for NonSendSync<&mut T>

Source§

type Out<'a> = NonSendSync<UniqueViewMut<'a, T>>

Source§

fn get_unique<'a>( all_storages: &'a AllStorages, all_borrow: Option<SharedBorrow<'a>>, ) -> Result<Self::Out<'a>, GetStorage>

Source§

impl<T: Component> IterComponent for NonSendSync<&T>

Source§

type Shiperator<'a> = FullRawWindow<'a, T>

Source§

type Borrow<'a> = SharedBorrow<'a>

Source§

fn into_shiperator<'a>( all_storages: &'a AllStorages, all_borrow: Option<SharedBorrow<'a>>, current: TrackingTimestamp, _storage_ids: &mut ShipHashSet<StorageId>, ) -> Result<(Self::Shiperator<'a>, Option<SharedBorrow<'a>>, Self::Borrow<'a>, usize, RawEntityIdAccess), GetStorage>

Source§

impl<T: Component> IterComponent for NonSendSync<&mut T>

Source§

type Shiperator<'a> = FullRawWindowMut<'a, T, <T as Component>::Tracking>

Source§

type Borrow<'a> = ExclusiveBorrow<'a>

Source§

fn into_shiperator<'a>( all_storages: &'a AllStorages, all_borrow: Option<SharedBorrow<'a>>, current: TrackingTimestamp, _storage_ids: &mut ShipHashSet<StorageId>, ) -> Result<(Self::Shiperator<'a>, Option<SharedBorrow<'a>>, Self::Borrow<'a>, usize, RawEntityIdAccess), GetStorage>

Source§

impl<T: Component> IterComponent for NonSendSync<Mut<'_, T>>

Source§

type Shiperator<'a> = FullRawWindowMut<'a, T, Modification>

Source§

type Borrow<'a> = ExclusiveBorrow<'a>

Source§

fn into_shiperator<'a>( all_storages: &'a AllStorages, all_borrow: Option<SharedBorrow<'a>>, current: TrackingTimestamp, _storage_ids: &mut ShipHashSet<StorageId>, ) -> Result<(Self::Shiperator<'a>, Option<SharedBorrow<'a>>, Self::Borrow<'a>, usize, RawEntityIdAccess), GetStorage>

Source§

impl<T: Component> Storage for NonSendSync<SparseSet<T>>

Source§

fn delete(&mut self, entity: EntityId, current: TrackingTimestamp)

Deletes an entity from this storage.
Source§

fn clear(&mut self, current: TrackingTimestamp)

Deletes all components of this storage.
Source§

fn sparse_array(&self) -> Option<&SparseArray<EntityId, BUCKET_SIZE>>

Returns a SparseSet’s internal SparseArray.
Source§

fn memory_usage(&self) -> Option<StorageMemoryUsage>

Returns how much memory this storage uses.
Source§

fn is_empty(&self) -> bool

Returns true if the storage is empty.
Source§

fn clear_all_removed_and_deleted(&mut self)

Clear all deletion and removal tracking data.
Source§

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§

fn move_component_from( &mut self, other_all_storages: &mut AllStorages, from: EntityId, to: EntityId, current: TrackingTimestamp, other_current: TrackingTimestamp, )

Moves a component from a World to another.
Source§

fn try_clone(&self, other_current: TrackingTimestamp) -> Option<SBoxBuilder>

Attempts to clone the entire storage.
Source§

fn clone_component_to( &self, other_all_storages: &mut AllStorages, from: EntityId, to: EntityId, other_current: TrackingTimestamp, )

Clones a component from a World to another.
Source§

fn any(&self) -> &dyn Any

Casts to &dyn Any.
Source§

fn any_mut(&mut self) -> &mut dyn Any

Casts to &mut dyn Any.
Source§

fn name(&self) -> Cow<'static, str>

Returns the storage’s name.
Source§

fn clear_all_inserted(&mut self, current: TrackingTimestamp)

Clear all insertion tracking data.
Source§

fn clear_all_modified(&mut self, current: TrackingTimestamp)

Clear all modification tracking data.
Source§

impl<T: Unique> Storage for NonSendSync<UniqueStorage<T>>

Source§

fn memory_usage(&self) -> Option<StorageMemoryUsage>

Returns how much memory this storage uses.
Source§

fn is_empty(&self) -> bool

Returns true if the storage is empty.
Source§

fn clear_all_inserted(&mut self, current: TrackingTimestamp)

Clear all insertion tracking data.
Source§

fn clear_all_modified(&mut self, current: TrackingTimestamp)

Clear all modification tracking data.
Source§

fn try_clone(&self, other_current: TrackingTimestamp) -> Option<SBoxBuilder>

Attempts to clone the entire storage.
Source§

fn any(&self) -> &dyn Any

Casts to &dyn Any.
Source§

fn any_mut(&mut self) -> &mut dyn Any

Casts to &mut dyn Any.
Source§

fn delete(&mut self, entity: EntityId, current: TrackingTimestamp)

Deletes an entity from this storage.
Source§

fn clear(&mut self, current: TrackingTimestamp)

Deletes all components of this storage.
Source§

fn name(&self) -> Cow<'static, str>

Returns the storage’s name.
Source§

fn sparse_array(&self) -> Option<&SparseArray<EntityId, 32>>

Returns a SparseSet’s internal SparseArray.
Source§

fn clear_all_removed_and_deleted(&mut self)

Clear all deletion and removal tracking data.
Source§

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§

fn move_component_from( &mut self, other_all_storages: &mut AllStorages, from: EntityId, to: EntityId, current: TrackingTimestamp, other_current: TrackingTimestamp, )

Moves a component from a World to another.
Source§

fn clone_component_to( &self, other_all_storages: &mut AllStorages, from: EntityId, to: EntityId, other_current: TrackingTimestamp, )

Clones a component from a World to another.

Auto Trait Implementations§

§

impl<T> Freeze for NonSendSync<T>
where T: Freeze + ?Sized,

§

impl<T> RefUnwindSafe for NonSendSync<T>
where T: RefUnwindSafe + ?Sized,

§

impl<T> Send for NonSendSync<T>
where T: Send + ?Sized,

§

impl<T> Sync for NonSendSync<T>
where T: Sync + ?Sized,

§

impl<T> Unpin for NonSendSync<T>
where T: Unpin + ?Sized,

§

impl<T> UnwindSafe for NonSendSync<T>
where T: UnwindSafe + ?Sized,

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<S> TupleRetainStorage for S
where S: 'static + Storage,

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

impl<T> WorldBorrow for T
where T: Borrow,

Source§

type WorldView<'a> = <T as Borrow>::View<'a>

Source§

fn world_borrow( world: &World, last_run: Option<TrackingTimestamp>, current: TrackingTimestamp, ) -> Result<<T as WorldBorrow>::WorldView<'_>, GetStorage>

This function is where the actual borrowing happens.