pub struct LemmaBase { /* private fields */ }Expand description
The LemmaBase registry fetches Lemma source text from LemmaBase.
This is the default registry for the Lemma engine. It resolves @... identifiers
via GET {base}/{name}.lemma (name includes the leading @). The base depends on compile profile:
LemmaBase::BASE_URL (http://localhost:4222 in debug builds,
https://lemmabase.com in release builds).
LemmaBase.com returns the requested spec with all of its dependencies inlined, so the resolution loop typically completes in a single iteration.
This struct is only available when the registry feature is enabled (which it is
by default). Users who require strict sandboxing (no network access) can compile
without this feature.
Implementations§
Source§impl LemmaBase
impl LemmaBase
Sourcepub const BASE_URL: &'static str = "http://localhost:4222"
pub const BASE_URL: &'static str = "http://localhost:4222"
LemmaBase registry root: http://localhost:4222 when debug_assertions are on
(normal cargo build / cargo run), https://lemmabase.com in --release.
Same rule for any crate embedding this one (CLI, LSP, WASM) at that profile.
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new LemmaBase registry backed by the real HTTP client (reqwest on native, fetch on WASM).
Sourcepub fn test() -> Self
pub fn test() -> Self
Offline registry backed by Self::test_fixtures_dir (no network).
Integration tests and local runs use bundled fixtures under
engine/tests/registry_fixtures/ (@iso/countries, …).
Sourcepub fn test_fixtures_dir() -> PathBuf
pub fn test_fixtures_dir() -> PathBuf
Directory of bundled registry fixtures shipped with lemma-engine.
Sourcepub fn with_fixture_dir(dir: impl AsRef<Path>) -> Self
pub fn with_fixture_dir(dir: impl AsRef<Path>) -> Self
Offline registry reading lemma_deps/-shaped .lemma files from dir.