pub trait AdmixResource: Send + Sync {
Show 27 methods
// Required methods
fn new() -> Self
where Self: Sized;
fn resource_name(&self) -> &'static str;
fn base_path(&self) -> &'static str;
fn collection_name(&self) -> &'static str;
fn get_collection(&self) -> Collection<Document>;
fn clone_box(&self) -> Box<dyn AdmixResource>;
// Provided methods
fn menu_group(&self) -> Option<&'static str> { ... }
fn menu(&self) -> &'static str { ... }
fn allowed_roles(&self) -> Vec<String> { ... }
fn allowed_roles_with_permissions(&self) -> Value { ... }
fn visible_fields_for_role(&self, _roles: &[String]) -> Vec<String> { ... }
fn nested_resources(&self) -> Vec<Box<dyn AdmixNestedResource>> { ... }
fn custom_actions(&self) -> Vec<CustomAction> { ... }
fn allowed_actions(&self) -> Option<Vec<MenuAction>> { ... }
fn permit_keys(&self) -> Vec<&'static str> { ... }
fn readonly_keys(&self) -> Vec<&'static str> { ... }
fn form_structure(&self) -> Option<Value> { ... }
fn list_structure(&self) -> Option<Value> { ... }
fn view_structure(&self) -> Option<Value> { ... }
fn filters(&self) -> Option<Value> { ... }
fn list(
&self,
_req: &HttpRequest,
query: String,
) -> BoxFuture<'static, HttpResponse> { ... }
fn get(
&self,
_req: &HttpRequest,
id: String,
) -> BoxFuture<'static, HttpResponse> { ... }
fn create(
&self,
_req: &HttpRequest,
payload: Value,
) -> BoxFuture<'static, HttpResponse> { ... }
fn update(
&self,
_req: &HttpRequest,
id: String,
payload: Value,
) -> BoxFuture<'static, HttpResponse> { ... }
fn delete(
&self,
_req: &HttpRequest,
id: String,
) -> BoxFuture<'static, HttpResponse> { ... }
fn generate_menu(&self) -> Option<MenuItem> { ... }
fn build_adminx_menus(&self) -> Option<MenuItem> { ... }
}Required Methods§
fn new() -> Selfwhere
Self: Sized,
fn resource_name(&self) -> &'static str
fn base_path(&self) -> &'static str
fn collection_name(&self) -> &'static str
fn get_collection(&self) -> Collection<Document>
fn clone_box(&self) -> Box<dyn AdmixResource>
Provided Methods§
Optional parent/super menu name to group this resource under.
Menu label for this resource (default: same as resource_name)