Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/crates/wasi-nn/src/registry/mod.rs
2464 views
1
//! Define the registry API.
2
//!
3
//! A [`GraphRegistry`] is place to store backend graphs so they can be loaded
4
//! by name. This API does not mandate how a graph is loaded or how it must be
5
//! stored--it could be stored remotely and rematerialized when needed, e.g. A
6
//! naive in-memory implementation, [`InMemoryRegistry`] is provided for use
7
//! with the Wasmtime CLI.
8
9
mod in_memory;
10
11
use crate::Graph;
12
pub use in_memory::InMemoryRegistry;
13
14
pub trait GraphRegistry: Send + Sync {
15
fn get(&self, name: &str) -> Option<&Graph>;
16
fn get_mut(&mut self, name: &str) -> Option<&mut Graph>;
17
}
18
19