pub struct ActixAdminBuilder {
pub scopes: HashMap<String, Scope>,
pub custom_routes: Vec<(String, Route)>,
pub actix_admin: ActixAdmin,
pub custom_index: Option<Route>,
}Expand description
Represents a builder entity which helps generating the ActixAdmin configuration.
Prefer calling the inherent methods on ActixAdminBuilder directly; the
old ActixAdminBuilderTrait still exists as a compatibility shim but is
now just a re-export of the inherent methods and does not need to be
brought into scope.
Fields§
§scopes: HashMap<String, Scope>§custom_routes: Vec<(String, Route)>§actix_admin: ActixAdmin§custom_index: Option<Route>Implementations§
Source§impl ActixAdminBuilder
impl ActixAdminBuilder
pub fn new(configuration: ActixAdminConfiguration) -> Self
pub fn add_entity<E: ActixAdminViewModelTrait + 'static>( &mut self, view_model: &ActixAdminViewModel, )
pub fn add_entity_to_category<E: ActixAdminViewModelTrait + 'static>( &mut self, view_model: &ActixAdminViewModel, category_name: &str, )
pub fn add_custom_handler_for_index(&mut self, route: Route)
Sourcepub fn add_bulk_action_for_entity<E: ActixAdminViewModelTrait + ActixAdminBulkActionDispatch + 'static>(
&mut self,
action: ActixAdminBulkAction,
)
pub fn add_bulk_action_for_entity<E: ActixAdminViewModelTrait + ActixAdminBulkActionDispatch + 'static>( &mut self, action: ActixAdminBulkAction, )
Register a custom bulk action on an entity. action is the metadata
rendered in the list-page actions dropdown; the entity type E must
provide a run_bulk_action implementation (via
impl ActixAdminBulkActionDispatch for Entity) that matches on
action.name and executes the requested work.
pub fn add_custom_handler_to_category( &mut self, menu_element_name: &str, path: &str, route: Route, add_to_menu: bool, category_name: &str, )
pub fn add_card_grid( &mut self, menu_element_name: &str, path: &str, elements: Vec<Vec<String>>, add_to_menu: bool, )
pub fn add_card_grid_to_category( &mut self, menu_element_name: &str, path: &str, elements: Vec<Vec<String>>, add_to_menu: bool, category_name: &str, )
pub fn add_custom_handler( &mut self, menu_element_name: &str, path: &str, route: Route, add_to_menu: bool, )
pub fn add_support_handler(&mut self, arg: &str, support: Route)
pub fn add_custom_handler_for_entity<E: ActixAdminViewModelTrait + 'static>( &mut self, menu_element_name: &str, path: &str, route: Route, add_to_menu: bool, )
pub fn add_custom_handler_for_entity_in_category<E: ActixAdminViewModelTrait + 'static>( &mut self, menu_element_name: &str, path: &str, route: Route, category_name: &str, add_to_menu: bool, )
pub fn get_scope(self) -> Scope
pub fn get_actix_admin(&self) -> ActixAdmin
Trait Implementations§
Source§impl ActixAdminBuilderTrait for ActixAdminBuilder
impl ActixAdminBuilderTrait for ActixAdminBuilder
fn new(configuration: ActixAdminConfiguration) -> Self
fn get_scope(self) -> Scope
fn get_actix_admin(&self) -> ActixAdmin
Auto Trait Implementations§
impl !RefUnwindSafe for ActixAdminBuilder
impl !Send for ActixAdminBuilder
impl !Sync for ActixAdminBuilder
impl !UnwindSafe for ActixAdminBuilder
impl Freeze for ActixAdminBuilder
impl Unpin for ActixAdminBuilder
impl UnsafeUnpin for ActixAdminBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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 more