pub struct CatalogRegistry { /* private fields */ }Expand description
A collection of argumentation schemes, indexed for lookup.
Implementations§
Source§impl CatalogRegistry
impl CatalogRegistry
Sourcepub fn register(&mut self, scheme: SchemeSpec)
pub fn register(&mut self, scheme: SchemeSpec)
Register a scheme. The last write wins for duplicate ids or keys —
the crate::catalog tests guarantee no duplicates exist in the
default catalog.
Sourcepub fn by_id(&self, id: SchemeId) -> Option<&SchemeSpec>
pub fn by_id(&self, id: SchemeId) -> Option<&SchemeSpec>
Look up a scheme by its unique id.
Sourcepub fn by_key(&self, key: &str) -> Option<&SchemeSpec>
pub fn by_key(&self, key: &str) -> Option<&SchemeSpec>
Look up a scheme by its snake_case key (derived from the name).
Sourcepub fn by_category(&self, category: SchemeCategory) -> Vec<&SchemeSpec>
pub fn by_category(&self, category: SchemeCategory) -> Vec<&SchemeSpec>
Return all schemes in a given category.
Sourcepub fn all(&self) -> &[SchemeSpec]
pub fn all(&self) -> &[SchemeSpec]
Return all registered schemes.
Sourcepub fn with_walton_catalog() -> Self
pub fn with_walton_catalog() -> Self
Build a registry preloaded with the canonical Walton (2008) argumentation-scheme catalog.
Distinct from Default::default(), which returns an empty
registry. Reach for this when you want the full scheme library;
reach for Default::default() or new() when you want an
empty registry to populate yourself.
Sourcepub fn by_name(&self, name: &str) -> Option<&SchemeSpec>
pub fn by_name(&self, name: &str) -> Option<&SchemeSpec>
Look up a scheme by its canonical (human-readable) name.
Names are matched exactly (case-sensitive). Use Self::by_key to
look up by the derived snake_case key instead.
Trait Implementations§
Source§impl Clone for CatalogRegistry
impl Clone for CatalogRegistry
Source§fn clone(&self) -> CatalogRegistry
fn clone(&self) -> CatalogRegistry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more