pub struct Registry { /* private fields */ }Expand description
A component registry loaded from a crate’s registry directory.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn load(dir: PathBuf) -> Result<Self, Error>
pub fn load(dir: PathBuf) -> Result<Self, Error>
Loads a registry by reading and parsing the registry.toml in dir (a
registry crate’s declared registry directory).
§Errors
Returns an error if the manifest cannot be read or parsed, or if it
declares a format version newer than MANIFEST_VERSION.
Sourcepub fn names(&self) -> impl Iterator<Item = &str>
pub fn names(&self) -> impl Iterator<Item = &str>
The names of every component in the registry, sorted.
Sourcepub fn get(&self, name: &str) -> Option<Component<'_>>
pub fn get(&self, name: &str) -> Option<Component<'_>>
Looks up a component by its registry name.
Sourcepub fn theme_names(&self) -> impl Iterator<Item = &str>
pub fn theme_names(&self) -> impl Iterator<Item = &str>
The names of every theme the registry offers, sorted.
Auto Trait Implementations§
impl Freeze for Registry
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
impl UnwindSafe 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