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.
The closure can be called multiple times.
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.
The closure can be called multiple times.
Sourcepub fn get(
&self,
filter: impl FnMut(&ConfigKey, &CategoryId) -> bool,
sort: bool,
) -> Vec<(Category, Vec<Setting>)>
pub fn get( &self, filter: impl FnMut(&ConfigKey, &CategoryId) -> bool, sort: bool, ) -> Vec<(Category, Vec<Setting>)>
Select and sort settings matched by filter.
This calls all registered closures that are not excluded by filter.
Sourcepub fn any(&self, filter: impl FnMut(&ConfigKey, &CategoryId) -> bool) -> bool
pub fn any(&self, filter: impl FnMut(&ConfigKey, &CategoryId) -> bool) -> bool
Gets if there are any setting matched by filter.
Sourcepub fn count(
&self,
filter: impl FnMut(&ConfigKey, &CategoryId) -> bool,
) -> usize
pub fn count( &self, filter: impl FnMut(&ConfigKey, &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.
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> 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> 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