pub struct ShardConfig {
pub current: u32,
pub total: u32,
}Expand description
Shard configuration for distributed test execution
Fields§
§current: u32Current shard index (1-based)
total: u32Total number of shards
Implementations§
Source§impl ShardConfig
impl ShardConfig
Sourcepub fn parse(s: &str) -> Result<Self, ShardParseError>
pub fn parse(s: &str) -> Result<Self, ShardParseError>
Sourcepub fn should_run_index(&self, test_index: usize) -> bool
pub fn should_run_index(&self, test_index: usize) -> bool
Check if a test at given index should run on this shard
Uses modulo distribution for even test distribution.
Sourcepub fn should_run_name(&self, test_name: &str) -> bool
pub fn should_run_name(&self, test_name: &str) -> bool
Check if a test with given name should run on this shard
Uses deterministic hash-based distribution for stable assignment.
Sourcepub fn filter_tests<'a>(&self, tests: &'a [&str]) -> Vec<&'a str>
pub fn filter_tests<'a>(&self, tests: &'a [&str]) -> Vec<&'a str>
Filter a list of tests to only those that should run on this shard
Sourcepub fn filter_by_index<T: Clone>(&self, items: &[T]) -> Vec<T>
pub fn filter_by_index<T: Clone>(&self, items: &[T]) -> Vec<T>
Filter tests by index
Sourcepub fn estimated_count(&self, total_tests: usize) -> usize
pub fn estimated_count(&self, total_tests: usize) -> usize
Get estimated test count for this shard
Sourcepub fn validate_coverage(total_tests: usize, total_shards: u32) -> bool
pub fn validate_coverage(total_tests: usize, total_shards: u32) -> bool
Validate that all shards together cover all tests exactly once
Trait Implementations§
Source§impl Clone for ShardConfig
impl Clone for ShardConfig
Source§fn clone(&self) -> ShardConfig
fn clone(&self) -> ShardConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ShardConfig
impl Debug for ShardConfig
Source§impl Default for ShardConfig
impl Default for ShardConfig
Source§impl<'de> Deserialize<'de> for ShardConfig
impl<'de> Deserialize<'de> for ShardConfig
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
Source§impl Display for ShardConfig
impl Display for ShardConfig
Source§impl PartialEq for ShardConfig
impl PartialEq for ShardConfig
Source§impl Serialize for ShardConfig
impl Serialize for ShardConfig
impl Copy for ShardConfig
impl Eq for ShardConfig
impl StructuralPartialEq for ShardConfig
Auto Trait Implementations§
impl Freeze for ShardConfig
impl RefUnwindSafe for ShardConfig
impl Send for ShardConfig
impl Sync for ShardConfig
impl Unpin for ShardConfig
impl UnsafeUnpin for ShardConfig
impl UnwindSafe for ShardConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().