AdmixResource

Trait AdmixResource 

Source
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§

Source

fn new() -> Self
where Self: Sized,

Source

fn resource_name(&self) -> &'static str

Source

fn base_path(&self) -> &'static str

Source

fn collection_name(&self) -> &'static str

Source

fn get_collection(&self) -> Collection<Document>

Source

fn clone_box(&self) -> Box<dyn AdmixResource>

Provided Methods§

Source

fn menu_group(&self) -> Option<&'static str>

Optional parent/super menu name to group this resource under.

Source

fn menu(&self) -> &'static str

Menu label for this resource (default: same as resource_name)

Source

fn allowed_roles(&self) -> Vec<String>

Source

fn allowed_roles_with_permissions(&self) -> Value

Source

fn visible_fields_for_role(&self, _roles: &[String]) -> Vec<String>

Source

fn nested_resources(&self) -> Vec<Box<dyn AdmixNestedResource>>

Source

fn custom_actions(&self) -> Vec<CustomAction>

Source

fn allowed_actions(&self) -> Option<Vec<MenuAction>>

Source

fn permit_keys(&self) -> Vec<&'static str>

Source

fn readonly_keys(&self) -> Vec<&'static str>

Source

fn form_structure(&self) -> Option<Value>

Source

fn list_structure(&self) -> Option<Value>

Source

fn view_structure(&self) -> Option<Value>

Source

fn filters(&self) -> Option<Value>

Source

fn list( &self, _req: &HttpRequest, query: String, ) -> BoxFuture<'static, HttpResponse>

Source

fn get( &self, _req: &HttpRequest, id: String, ) -> BoxFuture<'static, HttpResponse>

Source

fn create( &self, _req: &HttpRequest, payload: Value, ) -> BoxFuture<'static, HttpResponse>

Source

fn update( &self, _req: &HttpRequest, id: String, payload: Value, ) -> BoxFuture<'static, HttpResponse>

Source

fn delete( &self, _req: &HttpRequest, id: String, ) -> BoxFuture<'static, HttpResponse>

Source

fn generate_menu(&self) -> Option<MenuItem>

Source

fn build_adminx_menus(&self) -> Option<MenuItem>

Trait Implementations§

Source§

impl Clone for Box<dyn AdmixResource>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§