pub struct ExperimentAdminModel;Expand description
Admin panel model for A/B experiments.
Register this model with the admin plugin to get an experiment management UI
at /admin/experiments/:
ⓘ
use autumn_admin_plugin::{prelude::*, AdminPlugin};
use autumn_admin_plugin::experiments::ExperimentAdminModel;
autumn_web::app()
.plugin(
AdminPlugin::new()
.register(ExperimentAdminModel::default()),
)
.run()
.await;Trait Implementations§
Source§impl AdminModel for ExperimentAdminModel
impl AdminModel for ExperimentAdminModel
Source§fn slug(&self) -> &'static str
fn slug(&self) -> &'static str
URL-safe slug for this model (e.g., “projects”, “tickets”).
Used in admin URLs:
/admin/projects/, /admin/projects/42/.Source§fn display_name(&self) -> &'static str
fn display_name(&self) -> &'static str
Human-readable singular name (e.g., “Project”).
Source§fn display_name_plural(&self) -> &'static str
fn display_name_plural(&self) -> &'static str
Human-readable plural name (e.g., “Projects”).
Source§fn record_display(&self, record: &Value) -> String
fn record_display(&self, record: &Value) -> String
Return a display string for a record (used in breadcrumbs, titles). Read more
Source§fn fields(&self) -> Vec<AdminField>
fn fields(&self) -> Vec<AdminField>
Field metadata for this model.
Source§fn has_history(&self) -> bool
fn has_history(&self) -> bool
Whether this model has automatic record version history enabled. Read more
Source§fn list(
&self,
pool: &Pool<AsyncPgConnection>,
params: ListParams,
) -> AdminFuture<'_, ListResult>
fn list( &self, pool: &Pool<AsyncPgConnection>, params: ListParams, ) -> AdminFuture<'_, ListResult>
List records with pagination, search, sort, and filters.
Source§fn get(
&self,
pool: &Pool<AsyncPgConnection>,
id: i64,
) -> AdminFuture<'_, Option<Value>>
fn get( &self, pool: &Pool<AsyncPgConnection>, id: i64, ) -> AdminFuture<'_, Option<Value>>
Get a single record by ID.
Source§fn create(
&self,
pool: &Pool<AsyncPgConnection>,
data: Value,
) -> AdminFuture<'_, Value>
fn create( &self, pool: &Pool<AsyncPgConnection>, data: Value, ) -> AdminFuture<'_, Value>
Create a new record from form data.
Source§fn update(
&self,
pool: &Pool<AsyncPgConnection>,
id: i64,
data: Value,
) -> AdminFuture<'_, Value>
fn update( &self, pool: &Pool<AsyncPgConnection>, id: i64, data: Value, ) -> AdminFuture<'_, Value>
Update an existing record.
Source§fn delete(&self, pool: &Pool<AsyncPgConnection>, id: i64) -> AdminFuture<'_, ()>
fn delete(&self, pool: &Pool<AsyncPgConnection>, id: i64) -> AdminFuture<'_, ()>
Delete a record by ID.
Source§fn get_history<'a>(
&'a self,
pool: &'a Pool<AsyncPgConnection>,
record_id: i64,
page: u64,
per_page: u64,
) -> AdminFuture<'a, AdminHistoryPage>
fn get_history<'a>( &'a self, pool: &'a Pool<AsyncPgConnection>, record_id: i64, page: u64, per_page: u64, ) -> AdminFuture<'a, AdminHistoryPage>
Retrieve a paginated page of version history entries for a record. Read more
Source§fn supports_soft_delete(&self) -> bool
fn supports_soft_delete(&self) -> bool
Whether this model supports soft-delete (defaults to
false). Read moreSource§fn restore<'a>(
&'a self,
_pool: &'a Pool<AsyncPgConnection>,
_id: i64,
) -> AdminFuture<'a, ()>
fn restore<'a>( &'a self, _pool: &'a Pool<AsyncPgConnection>, _id: i64, ) -> AdminFuture<'a, ()>
Restore a soft-deleted record (set
deleted_at = NULL). Read moreSource§fn purge<'a>(
&'a self,
_pool: &'a Pool<AsyncPgConnection>,
_id: i64,
) -> AdminFuture<'a, ()>
fn purge<'a>( &'a self, _pool: &'a Pool<AsyncPgConnection>, _id: i64, ) -> AdminFuture<'a, ()>
Permanently delete (purge) a soft-deleted record. Read more
Source§fn list_deleted<'a>(
&'a self,
_pool: &'a Pool<AsyncPgConnection>,
_params: ListParams,
) -> AdminFuture<'a, ListResult>
fn list_deleted<'a>( &'a self, _pool: &'a Pool<AsyncPgConnection>, _params: ListParams, ) -> AdminFuture<'a, ListResult>
List soft-deleted records (where
deleted_at IS NOT NULL). Read moreSource§fn execute_action(
&self,
pool: &Pool<AsyncPgConnection>,
action: &str,
ids: Vec<i64>,
) -> AdminFuture<'_, u64>
fn execute_action( &self, pool: &Pool<AsyncPgConnection>, action: &str, ids: Vec<i64>, ) -> AdminFuture<'_, u64>
Execute a bulk action on the given IDs.
Source§fn count(&self, pool: &Pool<AsyncPgConnection>) -> AdminFuture<'_, u64>
fn count(&self, pool: &Pool<AsyncPgConnection>) -> AdminFuture<'_, u64>
Count records matching a list query (defaults to
list(..., per_page: 0).total). Read moreSource§fn supports_csv_export(&self) -> bool
fn supports_csv_export(&self) -> bool
Whether this model exposes a
GET /admin/{slug}/export.csv link. Read moreSource§fn csv_export_columns(&self) -> Vec<&'static str>
fn csv_export_columns(&self) -> Vec<&'static str>
Column names written to the CSV header row during export. Read more
Source§fn supports_csv_import(&self) -> bool
fn supports_csv_import(&self) -> bool
Whether this model accepts
POST /admin/{slug}/import CSV uploads. Read moreSource§fn import_csv_row<'a>(
&'a self,
_pool: &'a Pool<AsyncPgConnection>,
_line: u64,
_row: HashMap<String, String>,
_mode: CsvImportMode,
) -> AdminFuture<'a, AdminImportRowResult>
fn import_csv_row<'a>( &'a self, _pool: &'a Pool<AsyncPgConnection>, _line: u64, _row: HashMap<String, String>, _mode: CsvImportMode, ) -> AdminFuture<'a, AdminImportRowResult>
Process a single CSV row during an admin import. Read more
Source§impl Clone for ExperimentAdminModel
impl Clone for ExperimentAdminModel
Source§fn clone(&self) -> ExperimentAdminModel
fn clone(&self) -> ExperimentAdminModel
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ExperimentAdminModel
impl Debug for ExperimentAdminModel
Source§impl Default for ExperimentAdminModel
impl Default for ExperimentAdminModel
Source§fn default() -> ExperimentAdminModel
fn default() -> ExperimentAdminModel
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ExperimentAdminModel
impl RefUnwindSafe for ExperimentAdminModel
impl Send for ExperimentAdminModel
impl Sync for ExperimentAdminModel
impl Unpin for ExperimentAdminModel
impl UnsafeUnpin for ExperimentAdminModel
impl UnwindSafe for ExperimentAdminModel
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Add an aggregate function filter Read more
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
Add an aggregate function order Read more
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self to an expression for Diesel’s query builder. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> RepositoryHooksClone for Twhere
T: Clone,
impl<T> RepositoryHooksClone for Twhere
T: Clone,
Source§fn autumn_clone(&self) -> T
fn autumn_clone(&self) -> T
Clone hook state for generated repository values.
Source§impl<T> RepositoryHooksDefault for Twhere
T: Default,
impl<T> RepositoryHooksDefault for Twhere
T: Default,
Source§fn autumn_default() -> T
fn autumn_default() -> T
Construct a hook instance for generated repository state.
Source§impl<T, Conn> RunQueryDsl<Conn> for T
impl<T, Conn> RunQueryDsl<Conn> for T
Source§fn execute<'conn, 'query>(
self,
conn: &'conn mut Conn,
) -> <Conn as AsyncConnectionCore>::ExecuteFuture<'conn, 'query>
fn execute<'conn, 'query>( self, conn: &'conn mut Conn, ) -> <Conn as AsyncConnectionCore>::ExecuteFuture<'conn, 'query>
Executes the given command, returning the number of rows affected. Read more
Source§fn load<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>
fn load<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>
Source§fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnectionCore,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnectionCore,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
Executes the given query, returning a [
Stream] with the returned rows. Read moreSource§fn get_result<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, LoadNext<Pin<Box<Self::Stream<'conn>>>>>
fn get_result<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<Self::LoadFuture<'conn>, LoadNext<Pin<Box<Self::Stream<'conn>>>>>
Runs the command, and returns the affected row. Read more
Source§fn get_results<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>
fn get_results<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>>
Runs the command, returning an
Vec with the affected rows. Read moreSource§impl<T> Scoped for T
impl<T> Scoped for T
Source§fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
fn scope(ctx: &PolicyContext) -> ScopeQuery<'_, Self>
Open a deferred
ScopeQuery for this type. Resolves the
registered scope at .load() time, not here.Source§impl<T> WindowExpressionMethods for T
impl<T> WindowExpressionMethods for T
Source§fn over(self) -> Self::Outputwhere
Self: OverDsl,
fn over(self) -> Self::Outputwhere
Self: OverDsl,
Turn a function call into a window function call Read more
Source§fn window_filter<P>(self, f: P) -> Self::Output
fn window_filter<P>(self, f: P) -> Self::Output
Add a filter to the current window function Read more
Source§fn partition_by<E>(self, expr: E) -> Self::Outputwhere
Self: PartitionByDsl<E>,
fn partition_by<E>(self, expr: E) -> Self::Outputwhere
Self: PartitionByDsl<E>,
Add a partition clause to the current window function Read more
Source§fn window_order<E>(self, expr: E) -> Self::Outputwhere
Self: OrderWindowDsl<E>,
fn window_order<E>(self, expr: E) -> Self::Outputwhere
Self: OrderWindowDsl<E>,
Add a order clause to the current window function Read more