Struct necsim_partitioning_core::partition::Partition
source · pub struct Partition { /* private fields */ }
Implementations§
source§impl Partition
impl Partition
sourcepub const fn try_new(
rank: u32,
size: PartitionSize
) -> Result<Self, PartitionRankOutOfBounds>
pub const fn try_new( rank: u32, size: PartitionSize ) -> Result<Self, PartitionRankOutOfBounds>
Creates a Partition
from a rank
and number of partitions.
§Errors
Returns PartitionRankOutOfBounds
if rank >= size
.
sourcepub const unsafe fn new_unchecked(rank: u32, size: PartitionSize) -> Self
pub const unsafe fn new_unchecked(rank: u32, size: PartitionSize) -> Self
Creates a Partition
from a rank
and number of partitions.
§Safety
The number of partitions must be strictly greater than rank
.
pub const fn root(size: PartitionSize) -> Self
pub const fn monolithic() -> Self
pub const fn rank(self) -> u32
pub const fn size(self) -> PartitionSize
pub const fn is_root(self) -> bool
Trait Implementations§
source§impl<'de> Deserialize<'de> for Partition
impl<'de> Deserialize<'de> for Partition
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for Partition
Auto Trait Implementations§
impl Freeze for Partition
impl RefUnwindSafe for Partition
impl Send for Partition
impl Sync for Partition
impl Unpin for Partition
impl UnwindSafe for Partition
Blanket Implementations§
§impl<T> Backup for Twhere
T: Clone,
impl<T> Backup for Twhere
T: Clone,
default unsafe fn backup_unchecked(&self) -> T
default unsafe fn __contracts_impl_backup_unchecked(&self) -> T
fn backup(&self) -> BackedUp<Self>
§impl<T> Backup for Twhere
T: Copy,
impl<T> Backup for Twhere
T: Copy,
unsafe fn __contracts_impl_backup_unchecked(&self) -> T
unsafe fn backup_unchecked(&self) -> Self
fn backup(&self) -> BackedUp<Self>
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<T> ExtractDiscriminant for T
impl<T> ExtractDiscriminant for T
§type Discriminant = <T as ExtractDiscriminantSpec<<T as DiscriminantKind>::Discriminant>>::Ty
type Discriminant = <T as ExtractDiscriminantSpec<<T as DiscriminantKind>::Discriminant>>::Ty
The type of the discriminant, which must satisfy the trait bounds
required by
core::mem::Discriminant
. Read more