MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / get

Method get

crates/opencode-provider/src/models.rs:114–122  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

112 }
113
114 pub async fn get(&self) -> ModelsData {
115 let data = self.data.read().await;
116 if let Some(ref d) = *data {
117 return d.clone();
118 }
119 drop(data);
120
121 self.load().await
122 }
123
124 async fn load(&self) -> ModelsData {
125 if let Ok(content) = tokio::fs::read_to_string(&self.cache_path).await {

Callers 5

fetchMethod · 0.45
get_providerMethod · 0.45
get_modelMethod · 0.45

Calls 3

readMethod · 0.80
cloneMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected