pub struct ListView {Show 16 fields
pub model_name: String,
pub verbose_name: String,
pub title: String,
pub breadcrumbs: Vec<Breadcrumb>,
pub columns: Vec<TableColumn>,
pub rows: Vec<TableRow>,
pub pagination: Pagination,
pub filters: Vec<FilterDef>,
pub search_query: Option<String>,
pub can_add: bool,
pub can_delete: bool,
pub can_export: bool,
pub add_url: String,
pub search_placeholder: String,
pub has_search: bool,
pub has_filters: bool,
}Expand description
List view for a model
Fields§
§model_name: StringModel name
verbose_name: StringVerbose name (plural)
title: StringPage title
Breadcrumbs
columns: Vec<TableColumn>Table columns
rows: Vec<TableRow>Table rows
pagination: PaginationPagination
filters: Vec<FilterDef>Filters
search_query: Option<String>Current search query
can_add: boolCan add new records?
can_delete: boolCan delete records?
can_export: boolCan export?
add_url: StringAdd URL
search_placeholder: StringSearch placeholder
has_search: boolHas search enabled?
has_filters: boolHas filters?
Implementations§
Source§impl ListView
impl ListView
Sourcepub fn new(model: &ModelDefinition, params: ListParams, per_page: usize) -> Self
pub fn new(model: &ModelDefinition, params: ListParams, per_page: usize) -> Self
Create a new list view.
per_page is the already-resolved page size (see
ListParams::resolve_per_page); rows are filled in separately from a
crate::data::DataSource via ListView::with_json_rows.
Sourcepub fn with_rows(self, rows: Vec<TableRow>, total: usize) -> Self
pub fn with_rows(self, rows: Vec<TableRow>, total: usize) -> Self
Set pre-built rows (from a data source), recomputing pagination.
Sourcepub fn with_json_rows(
self,
model: &ModelDefinition,
config: &AdminConfig,
records: &[Value],
total: usize,
) -> Self
pub fn with_json_rows( self, model: &ModelDefinition, config: &AdminConfig, records: &[Value], total: usize, ) -> Self
Populate rows from raw JSON records returned by a
crate::data::DataSource, rendering each display column’s cell and
honoring the configured date/datetime formats.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ListView
impl<'de> Deserialize<'de> for ListView
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ListView
impl RefUnwindSafe for ListView
impl Send for ListView
impl Sync for ListView
impl Unpin for ListView
impl UnsafeUnpin for ListView
impl UnwindSafe for ListView
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<R, D> DepsPresent<D> for R
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging