pub struct GlobalSearch<M> { /* private fields */ }Expand description
How a resource’s records show in its panel’s global search, as
ResourceDef::global_search declares it: the details listed under each result’s title.
use tablo_core::{GlobalSearch, ResourceDef, lens};
ResourceDef::new()
.record_title(lens!(User.name))
.global_search(GlobalSearch::new().detail("Email", lens!(User.email)))Implementations§
Source§impl<M> GlobalSearch<M>
impl<M> GlobalSearch<M>
Sourcepub fn new() -> GlobalSearch<M>
pub fn new() -> GlobalSearch<M>
A result with its title alone.
Sourcepub fn detail<T>(
self,
label: impl Into<Text>,
lens: Lens<M, T>,
) -> GlobalSearch<M>
pub fn detail<T>( self, label: impl Into<Text>, lens: Lens<M, T>, ) -> GlobalSearch<M>
Lists the value lens reads under each result’s title, labelled label, after the
details already declared.
A result leaves out an empty value, and every value of a field field access hides from the request.
Trait Implementations§
Source§impl<M> Clone for GlobalSearch<M>
impl<M> Clone for GlobalSearch<M>
Source§fn clone(&self) -> GlobalSearch<M>
fn clone(&self) -> GlobalSearch<M>
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<M> Debug for GlobalSearch<M>
impl<M> Debug for GlobalSearch<M>
Source§impl<M> Default for GlobalSearch<M>
impl<M> Default for GlobalSearch<M>
Source§fn default() -> GlobalSearch<M>
fn default() -> GlobalSearch<M>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<M> !RefUnwindSafe for GlobalSearch<M>
impl<M> !UnwindSafe for GlobalSearch<M>
impl<M> Freeze for GlobalSearch<M>
impl<M> Send for GlobalSearch<M>
impl<M> Sync for GlobalSearch<M>
impl<M> Unpin for GlobalSearch<M>
impl<M> UnsafeUnpin for GlobalSearch<M>
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