pub enum Setup {
Defs(Vec<CgroupDef>),
Factory(fn(&Ctx<'_>) -> Vec<CgroupDef>),
}Expand description
How to produce the CgroupDefs for a step’s setup phase.
Construct via Setup::Defs(vec) (variant constructor for a static
list), Setup::with_factory (runtime-generated from &Ctx),
Setup::default() (no cgroups — Setup::Defs(Vec::new())), or via
From<Vec<CgroupDef>> (vec![def1, def2].into()).
Variants§
Defs(Vec<CgroupDef>)
Static list of cgroup definitions.
Factory(fn(&Ctx<'_>) -> Vec<CgroupDef>)
Factory that generates definitions from the runtime context.
Implementations§
Source§impl Setup
impl Setup
Sourcepub const fn with_factory(f: fn(&Ctx<'_>) -> Vec<CgroupDef>) -> Self
pub const fn with_factory(f: fn(&Ctx<'_>) -> Vec<CgroupDef>) -> Self
Construct a Setup::Factory from a function pointer.
with_factory per the scenario-module builder convention
(with_X = constructor variant; see the module-level docs
on crate::scenario). The Defs variant is constructed
directly via Setup::Defs(vec) (variant constructor) or
Default::default() for the empty case; Factory needs a
named constructor because variant construction with a fn
pointer literal is awkward to read.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Setup
impl RefUnwindSafe for Setup
impl Send for Setup
impl Sync for Setup
impl Unpin for Setup
impl UnwindSafe for Setup
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<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