#[non_exhaustive]pub enum SpawnPlacement {
RunnerCgroup,
Cgroup(Cow<'static, str>),
}Expand description
Placement target for Op::Spawn.
The previous taxonomy had two ops (SpawnWorkers and SpawnHost)
representing the two placement choices; the unified Op::Spawn
variant parameterises the placement so the framework has ONE
spawn op with the placement as data. SpawnPlacement is
#[non_exhaustive]; further placements are added here rather
than as new Op variants.
§#[non_exhaustive]
SpawnPlacement is #[non_exhaustive] — see
[crate::non_exhaustive] for the cross-crate pattern-match and
construction rules shared by every such type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
RunnerCgroup
Spawn workers in the spawner’s own cgroup — the test
runner’s cgroup, NOT any managed workload cgroup declared
via CgroupDef or Op::AddCgroup. The handler issues
ZERO cgroup ops; the workers inherit whatever cgroup the
test runner sits in.
Inside a guest VM the runner’s cgroup is typically the root (cgid=1), so RunnerCgroup workers appear in snapshots under the root cgroup rather than under your workload’s named hierarchy.
WorkSpec::workers_pct is rejected for this placement —
there’s no managed cgroup whose cpuset would supply the
percentage denominator. Use an explicit .workers(N)
count, or switch to Cgroup(name) against a cgroup whose
cpuset gives workers_pct a denominator.
§Why “RunnerCgroup”?
The previous shape used SpawnHost — “host” referred to
the spawner’s own cgroup (analogous to the
scheduler-observability “host tasks vs workload tasks”
distinction in sched_ext schedulers, e.g. mitosis’s cell
0). RunnerCgroup names the placement target precisely
(the test-runner process’s cgroup) without the
host-vs-guest-machine ambiguity that “host” carried.
Cgroup(Cow<'static, str>)
Spawn workers and move them into the named managed
cgroup. The cgroup must already exist when the spawn op
applies — declared via CgroupDef in Step.setup,
via Op::AddCgroup / Op::AddCgroupDef earlier in
the same step, or on the persistent
Backdrop.
Implementations§
Source§impl SpawnPlacement
impl SpawnPlacement
Sourcepub fn cgroup(name: impl Into<Cow<'static, str>>) -> Self
pub fn cgroup(name: impl Into<Cow<'static, str>>) -> Self
Construct SpawnPlacement::Cgroup from any string-like
input (&'static str, String, Cow<'static, str>).
Mirrors the [impl Into<Cow<'static, str>>] convention
used by every other cgroup-name constructor on Op
(Op::add_cgroup, Op::spawn_workers, Op::move_all_tasks,
…) so callers pass "name" not "name".into().
Sourcepub const fn runner_cgroup() -> Self
pub const fn runner_cgroup() -> Self
Construct SpawnPlacement::RunnerCgroup. Const so it
composes inside const scenarios + builds.
Trait Implementations§
Source§impl Clone for SpawnPlacement
impl Clone for SpawnPlacement
Source§fn clone(&self) -> SpawnPlacement
fn clone(&self) -> SpawnPlacement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SpawnPlacement
impl Debug for SpawnPlacement
Source§impl Hash for SpawnPlacement
impl Hash for SpawnPlacement
Source§impl PartialEq for SpawnPlacement
impl PartialEq for SpawnPlacement
impl Eq for SpawnPlacement
impl StructuralPartialEq for SpawnPlacement
Auto Trait Implementations§
impl Freeze for SpawnPlacement
impl RefUnwindSafe for SpawnPlacement
impl Send for SpawnPlacement
impl Sync for SpawnPlacement
impl Unpin for SpawnPlacement
impl UnwindSafe for SpawnPlacement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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