#[non_exhaustive]pub struct ViewVariant {
pub id: String,
pub caption: String,
pub filter: Option<String>,
pub columns: Vec<String>,
pub editor: Option<String>,
}Expand description
Another way to see the list of an entity, which people pick from a menu once there are two.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringWhat it is known by.
caption: StringWhat people see.
filter: Option<String>What its records have to meet; nothing means all of them.
columns: Vec<String>The fields its columns show, in order; nothing means those of the list.
editor: Option<String>The way it shows its records, by the name of a list editor; nothing means what the list uses.
Implementations§
Source§impl ViewVariant
impl ViewVariant
Sourcepub fn new(id: impl Into<String>, caption: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, caption: impl Into<String>) -> Self
A variant that shows every record.
Sourcepub fn filter(self, expression: impl Into<String>) -> Self
pub fn filter(self, expression: impl Into<String>) -> Self
Shows only the records that meet this expression.
Sourcepub fn editor(self, editor: impl Into<String>) -> Self
pub fn editor(self, editor: impl Into<String>) -> Self
Shows its records with the list editor of this name.
Sourcepub fn columns(
self,
fields: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn columns( self, fields: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Shows these fields as its columns, in this order.
Trait Implementations§
Source§impl Clone for ViewVariant
impl Clone for ViewVariant
Source§fn clone(&self) -> ViewVariant
fn clone(&self) -> ViewVariant
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ViewVariant
impl Debug for ViewVariant
impl Eq for ViewVariant
Source§impl PartialEq for ViewVariant
impl PartialEq for ViewVariant
impl StructuralPartialEq for ViewVariant
Auto Trait Implementations§
impl Freeze for ViewVariant
impl RefUnwindSafe for ViewVariant
impl Send for ViewVariant
impl Sync for ViewVariant
impl Unpin for ViewVariant
impl UnsafeUnpin for ViewVariant
impl UnwindSafe for ViewVariant
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