pub struct Registry { /* private fields */ }Implementations§
Source§impl Registry
impl Registry
pub fn builtin() -> Self
Sourcepub fn add_views(&mut self, views: &[SavedView])
pub fn add_views(&mut self, views: &[SavedView])
Register the saved views from views.toml as ordinary commands.
Views are user data, so their ids and titles are not known at compile time. They are
leaked deliberately: a Registry is built once at startup and lives for the whole
process, so this is a bounded, one-off allocation, and it is what lets a saved view
be a first-class command, reachable from :, the help overlay and a macro, rather
than a special case wired past the registry.
pub fn all(&self) -> &[Command]
pub fn get(&self, id: &str) -> Option<&Command>
Trait Implementations§
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