Struct zng_ext_config::settings::SETTINGS
source · 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(&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
.
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