pub struct Registry { /* private fields */ }Expand description
Every owner’s definitions in one namespace, checked for clashes.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn new(
owners: Vec<Arc<dyn SettingsOwner>>,
reserved_for: &[(&str, usize)],
) -> Result<Registry>
pub fn new( owners: Vec<Arc<dyn SettingsOwner>>, reserved_for: &[(&str, usize)], ) -> Result<Registry>
Merge the owners’ definitions.
reserved_for maps a top-level name (a key’s first segment) to the one owner, by
index, allowed to use it; names not listed are free. A key defined twice is
Error::Duplicate, a reserved name used by another owner is Error::Reserved,
and a definition without scopes or a secret outside the device scope is
Error::InvalidDef.
Sourcepub fn def(&self, key: &str) -> Result<(&SettingDef, &dyn SettingsOwner)>
pub fn def(&self, key: &str) -> Result<(&SettingDef, &dyn SettingsOwner)>
The definition of key and the owner that holds its files.
Sourcepub fn under(&self, prefix: &str) -> Vec<&SettingDef>
pub fn under(&self, prefix: &str) -> Vec<&SettingDef>
The definitions whose key is prefix or starts with prefix..
Sourcepub fn schema(&self) -> Vec<SettingDef>
pub fn schema(&self) -> Vec<SettingDef>
Every definition.
Auto Trait Implementations§
impl !RefUnwindSafe for Registry
impl !UnwindSafe for Registry
impl Forget for Registry
impl Freeze for Registry
impl Move for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
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