pub struct Registry { /* private fields */ }Expand description
The registry. Cheap to construct; all state lives on disk.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn open() -> Result<Registry>
pub fn open() -> Result<Registry>
Opens the default registry ($COMBS_HOME/mesh, else
~/.cache/combs/mesh), creating the directory if needed.
Sourcepub fn open_at(root: PathBuf) -> Result<Registry>
pub fn open_at(root: PathBuf) -> Result<Registry>
Opens a registry rooted at an explicit directory (tests, custom deployments).
Sourcepub fn register(&self, emoji: &Emoji) -> Result<String>
pub fn register(&self, emoji: &Emoji) -> Result<String>
Registers emoji: writes <sha256>.cmse and records the name in
the index. Returns the hash. Idempotent.
Sourcepub fn resolve(&self, name_or_hash: &str) -> Result<Emoji>
pub fn resolve(&self, name_or_hash: &str) -> Result<Emoji>
Resolves a name or a 64-char hex hash to an emoji.
Sourcepub fn list(&self) -> Result<Vec<RegistryEntry>>
pub fn list(&self) -> Result<Vec<RegistryEntry>>
Lists all registered emojis. Rebuilds the index from the directory when it is missing or corrupt.
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