pub struct Shard { /* private fields */ }Expand description
Share of a plan’s runs, the runs whose id leaves remainder index when divided by count.
Written INDEX/COUNT, as in 0/4.
Implementations§
Source§impl Shard
impl Shard
Sourcepub fn new(index: u64, count: u64) -> Result<Self, ShardError>
pub fn new(index: u64, count: u64) -> Result<Self, ShardError>
Returns shard index of count.
§Errors
Returns ShardError for a count of 0, or an index not below count.
Sourcepub fn index(self) -> u64
pub fn index(self) -> u64
Remainder the shard’s run ids leave when divided by Self::count.
Trait Implementations§
impl Copy for Shard
impl Eq for Shard
impl StructuralPartialEq for Shard
Auto Trait Implementations§
impl Freeze for Shard
impl RefUnwindSafe for Shard
impl Send for Shard
impl Sync for Shard
impl Unpin for Shard
impl UnsafeUnpin for Shard
impl UnwindSafe for Shard
Blanket Implementations§
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