Struct catalyst_entities::Cluster
source · pub struct Cluster<T> { /* private fields */ }Expand description
Helps splitting arrays of owned values into separate items without lifetimes. Everithing is dropped when all cluster borrows and the cluster is dropped.
Implementations§
source§impl<T> Cluster<T>
impl<T> Cluster<T>
sourcepub fn new(thread_count: u8) -> Selfwhere
T: Default,
pub fn new(thread_count: u8) -> Selfwhere T: Default,
Creates a new cluster with the given number of threads.
sourcepub fn split(&self) -> impl Iterator<Item = ClusterBorrow<T>> + '_
pub fn split(&self) -> impl Iterator<Item = ClusterBorrow<T>> + '_
gives mutable access to stored data and an iterator over the borrows
Panics
Panics if the cluster is still shared.
sourcepub fn expand(&mut self, thread_count: u8)where
T: Default,
pub fn expand(&mut self, thread_count: u8)where T: Default,
extends cluster up to the given thread count
sourcepub fn thread_count(&self) -> u8
pub fn thread_count(&self) -> u8
thread count getter
Trait Implementations§
source§impl<T> Archive for Cluster<T>where
ArcVec<T>: Archive,
impl<T> Archive for Cluster<T>where ArcVec<T>: Archive,
source§impl<__D: Fallible + ?Sized, T> Deserialize<Cluster<T>, __D> for Archived<Cluster<T>>where
ArcVec<T>: Archive,
Archived<ArcVec<T>>: Deserialize<ArcVec<T>, __D>,
impl<__D: Fallible + ?Sized, T> Deserialize<Cluster<T>, __D> for Archived<Cluster<T>>where ArcVec<T>: Archive, Archived<ArcVec<T>>: Deserialize<ArcVec<T>, __D>,
source§impl<__S: Fallible + ?Sized, T> Serialize<__S> for Cluster<T>where
ArcVec<T>: Serialize<__S>,
impl<__S: Fallible + ?Sized, T> Serialize<__S> for Cluster<T>where ArcVec<T>: Serialize<__S>,
impl<T: Send> Send for Cluster<T>
impl<T: Sync> Sync for Cluster<T>
Auto Trait Implementations§
impl<T> !ArchiveCopy for Cluster<T>
impl<T> !NoInteriorMutability for Cluster<T>
impl<T> RefUnwindSafe for Cluster<T>where T: RefUnwindSafe,
impl<T> Unpin for Cluster<T>
impl<T> UnwindSafe for Cluster<T>where T: RefUnwindSafe,
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere T: Archive,
§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike
Archive, it may be unsized. Read more§type MetadataResolver = ()
type MetadataResolver = ()
The resolver for the metadata of this type. Read more
source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata )
Creates the archived version of the metadata for this value at the given position and writes
it to the given output. Read more