pub struct SETTINGS;
Expand description
Settings metadata service.
Implementations§
source§impl SETTINGS
impl SETTINGS
sourcepub fn register(
&self,
f: impl Fn(&mut SettingsBuilder<'_>) + Send + Sync + 'static,
)
pub fn register( &self, f: impl Fn(&mut SettingsBuilder<'_>) + Send + Sync + 'static, )
Register a closure that provides settings metadata.
sourcepub fn register_categories(
&self,
f: impl Fn(&mut CategoriesBuilder<'_>) + Send + Sync + 'static,
)
pub fn register_categories( &self, f: impl Fn(&mut CategoriesBuilder<'_>) + Send + Sync + 'static, )
Register a closure that provides category metadata.
sourcepub fn get(
&self,
filter: impl FnMut(&Txt, &CategoryId) -> bool,
sort: bool,
) -> Vec<(Category, Vec<Setting>)>
pub fn get( &self, filter: impl FnMut(&Txt, &CategoryId) -> bool, sort: bool, ) -> Vec<(Category, Vec<Setting>)>
Select and sort settings matched by filter
.
sourcepub fn any(&self, filter: impl FnMut(&Txt, &CategoryId) -> bool) -> bool
pub fn any(&self, filter: impl FnMut(&Txt, &CategoryId) -> bool) -> bool
Gets if there are any setting matched by filter
.
sourcepub fn count(&self, filter: impl FnMut(&Txt, &CategoryId) -> bool) -> usize
pub fn count(&self, filter: impl FnMut(&Txt, &CategoryId) -> bool) -> usize
Count how many settings match the filter
.
sourcepub fn categories(
&self,
filter: impl FnMut(&CategoryId) -> bool,
include_empty: bool,
sort: bool,
) -> Vec<Category>
pub fn categories( &self, filter: impl FnMut(&CategoryId) -> bool, include_empty: bool, sort: bool, ) -> Vec<Category>
Select and sort categories matched by filter
.
If include_empty
is true
includes categories that have no settings.
sourcepub fn sort_settings(&self, settings: &mut [Setting])
pub fn sort_settings(&self, settings: &mut [Setting])
Sort settings
.
sourcepub fn sort_categories(&self, categories: &mut [Category])
pub fn sort_categories(&self, categories: &mut [Category])
Sort categories
.
Trait Implementations§
source§impl SettingsCtxExt for SETTINGS
impl SettingsCtxExt for SETTINGS
source§fn editor_search(&self) -> ContextVar<Txt>
fn editor_search(&self) -> ContextVar<Txt>
Gets a read-write context var that tracks the search text.
source§fn editor_selected_category(&self) -> ContextVar<CategoryId>
fn editor_selected_category(&self) -> ContextVar<CategoryId>
Gets a read-write context var that tracks the selected category.
source§fn editor_state(
&self,
) -> ReadOnlyVar<Option<SettingsEditorState>, ContextVar<Option<SettingsEditorState>>>
fn editor_state( &self, ) -> ReadOnlyVar<Option<SettingsEditorState>, ContextVar<Option<SettingsEditorState>>>
Gets a read-only context var that tracks the current editor data state.
source§fn editor_setting(
&self,
) -> ReadOnlyVar<Option<Setting>, ContextVar<Option<Setting>>>
fn editor_setting( &self, ) -> ReadOnlyVar<Option<Setting>, ContextVar<Option<Setting>>>
Gets a read-only context var that tracks the
Setting
entry the widget is inside, or will be.Auto Trait Implementations§
impl Freeze for SETTINGS
impl RefUnwindSafe for SETTINGS
impl Send for SETTINGS
impl Sync for SETTINGS
impl Unpin for SETTINGS
impl UnwindSafe for SETTINGS
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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