pub struct ListQuery {
pub page: u64,
pub entities_per_page: u64,
pub search: String,
pub sort_by: String,
pub sort_order: SortOrder,
pub filters: Vec<ActixAdminViewModelFilter>,
}Expand description
Fully-resolved list-page query state: pagination, search, sort and filters, normalized against the entity’s view model.
Fields§
§page: u64§entities_per_page: u64§search: String§sort_by: String§sort_order: SortOrder§filters: Vec<ActixAdminViewModelFilter>Implementations§
Source§impl ListQuery
impl ListQuery
Sourcepub fn from_query(qs: &str, view_model: &ActixAdminViewModel) -> Self
pub fn from_query(qs: &str, view_model: &ActixAdminViewModel) -> Self
Build a ListQuery from a raw querystring, filling in defaults
from view_model. Never fails.
Sourcepub fn from_params_and_filters(
params: Params,
filters: Vec<ActixAdminViewModelFilter>,
view_model: &ActixAdminViewModel,
) -> Self
pub fn from_params_and_filters( params: Params, filters: Vec<ActixAdminViewModelFilter>, view_model: &ActixAdminViewModel, ) -> Self
Build a ListQuery from a parsed Params plus a filter list.
Sourcepub fn from_form(
form: &[(String, String)],
view_model: &ActixAdminViewModel,
) -> Self
pub fn from_form( form: &[(String, String)], view_model: &ActixAdminViewModel, ) -> Self
Build a ListQuery from a form body of (key, value) pairs, used by
delete_many where the pagination state travels in the POST body
rather than the querystring.
Sourcepub fn to_query_string(&self) -> String
pub fn to_query_string(&self) -> String
Serialize back into a URL querystring (without a leading ?).
Uses serde_urlencoded so encoding matches how we parse.
Sourcepub fn to_view_model_params(
&self,
tenant_ref: Option<i32>,
paginated: bool,
) -> ActixAdminViewModelParams
pub fn to_view_model_params( &self, tenant_ref: Option<i32>, paginated: bool, ) -> ActixAdminViewModelParams
Convert into the ORM-facing ActixAdminViewModelParams. paginated
controls whether page/entities_per_page are forwarded; export_csv
passes false to fetch all rows.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ListQuery
impl RefUnwindSafe for ListQuery
impl Send for ListQuery
impl Sync for ListQuery
impl Unpin for ListQuery
impl UnsafeUnpin for ListQuery
impl UnwindSafe for ListQuery
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,
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