pub struct ExperimentGenerator { /* private fields */ }Expand description
The site’s generator with its experiments (spec 3.5 §7.12): after the inner generator
builds, each running experiment’s variant is written as its own static file under
/_exp/{id}/ — the control page with the plan’s changes, marked noindex, its canonical
link still naming the control — and the control, the variant and the goal pages load
/_awp/experiments.js with the experiment’s id, arm, allocation and the edge’s beacon.
Every file it adds or changes is reported as written and every file it takes out as removed, so incremental releases carry them. A stopped experiment’s variant leaves the build and its script tags leave the pages: the control is served alone. An experiment whose control page is missing or no longer holds a change’s text is left out of the build, with a warning, until its page matches again.
§Example
let generator = Arc::new(ExperimentGenerator::new(
Arc::new(BuiltinGenerator),
experiments.clone(),
site.id,
"https://edge.example/awp/v2/beacon",
));
let runtime = SiteRuntime::builder(site, base, store, generator, host, log, work).build();Implementations§
Source§impl ExperimentGenerator
impl ExperimentGenerator
Sourcepub fn new(
inner: Arc<dyn SiteGenerator>,
store: Arc<dyn ExperimentStore>,
site: Uuid,
beacon: impl Into<String>,
) -> Self
pub fn new( inner: Arc<dyn SiteGenerator>, store: Arc<dyn ExperimentStore>, site: Uuid, beacon: impl Into<String>, ) -> Self
inner with site’s experiments from store, counted at beacon, the edge’s
POST /awp/v2/beacon URL.
Trait Implementations§
Source§impl Debug for ExperimentGenerator
impl Debug for ExperimentGenerator
Source§impl SiteGenerator for ExperimentGenerator
impl SiteGenerator for ExperimentGenerator
Source§fn build<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
project: &'life1 SiteProject,
out: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<BuildReport>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn build<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
project: &'life1 SiteProject,
out: &'life2 Path,
) -> Pin<Box<dyn Future<Output = Result<BuildReport>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn build_incremental<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
project: &'life1 SiteProject,
out: &'life2 Path,
changes: &'life3 ChangeSet,
) -> Pin<Box<dyn Future<Output = Result<BuildReport>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn build_incremental<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
project: &'life1 SiteProject,
out: &'life2 Path,
changes: &'life3 ChangeSet,
) -> Pin<Box<dyn Future<Output = Result<BuildReport>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
out, which holds the build changes.previous describes, only what the
changed items affect. Generators without dependency tracking build everything. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ExperimentGenerator
impl !UnwindSafe for ExperimentGenerator
impl Forget for ExperimentGenerator
impl Freeze for ExperimentGeneratorwhere
*const ArcInner<dyn SiteGenerator> is !null: Freeze,
PhantomData<ArcInner<dyn SiteGenerator>>: Freeze,
*const ArcInner<dyn ExperimentStore> is !null: Freeze,
PhantomData<ArcInner<dyn ExperimentStore>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
impl Move for ExperimentGenerator
impl Send for ExperimentGenerator
impl Sync for ExperimentGenerator
impl Unpin for ExperimentGenerator
impl UnsafeUnpin for ExperimentGeneratorwhere
*const ArcInner<dyn SiteGenerator> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn SiteGenerator>>: UnsafeUnpin,
*const ArcInner<dyn ExperimentStore> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ExperimentStore>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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