pub struct ModelAdminConfigBuilder { /* private fields */ }Expand description
Builder for ModelAdminConfig
Implementations§
Source§impl ModelAdminConfigBuilder
impl ModelAdminConfigBuilder
Sourcepub fn model_name(self, name: impl Into<String>) -> Self
pub fn model_name(self, name: impl Into<String>) -> Self
Set the model name
Sourcepub fn table_name(self, name: impl Into<String>) -> Self
pub fn table_name(self, name: impl Into<String>) -> Self
Set the database table name
If not set, defaults to the model name.
Sourcepub fn pk_field(self, field: impl Into<String>) -> Self
pub fn pk_field(self, field: impl Into<String>) -> Self
Set the primary key field name
If not set, defaults to “id”.
Sourcepub fn list_display(self, fields: Vec<impl Into<String>>) -> Self
pub fn list_display(self, fields: Vec<impl Into<String>>) -> Self
Set list display fields
Sourcepub fn list_filter(self, fields: Vec<impl Into<String>>) -> Self
pub fn list_filter(self, fields: Vec<impl Into<String>>) -> Self
Set list filter fields
Sourcepub fn search_fields(self, fields: Vec<impl Into<String>>) -> Self
pub fn search_fields(self, fields: Vec<impl Into<String>>) -> Self
Set search fields
Sourcepub fn readonly_fields(self, fields: Vec<impl Into<String>>) -> Self
pub fn readonly_fields(self, fields: Vec<impl Into<String>>) -> Self
Set readonly fields
Sourcepub fn list_per_page(self, count: usize) -> Self
pub fn list_per_page(self, count: usize) -> Self
Set items per page
Sourcepub fn build(self) -> ModelAdminConfig
pub fn build(self) -> ModelAdminConfig
Trait Implementations§
Source§impl Debug for ModelAdminConfigBuilder
impl Debug for ModelAdminConfigBuilder
Source§impl Default for ModelAdminConfigBuilder
impl Default for ModelAdminConfigBuilder
Source§fn default() -> ModelAdminConfigBuilder
fn default() -> ModelAdminConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ModelAdminConfigBuilder
impl RefUnwindSafe for ModelAdminConfigBuilder
impl Send for ModelAdminConfigBuilder
impl Sync for ModelAdminConfigBuilder
impl Unpin for ModelAdminConfigBuilder
impl UnwindSafe for ModelAdminConfigBuilder
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
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().