INNER CODE UNIT · Rust
fmt
graphql-rust/graphql-client · graphql_client_codegen/src/lib.rs:36
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&self.0)
}
}
impl std::error::Error for GeneralError {}
type BoxError = Box<dyn std::error::Error + Send + Sync + 'static>;
type CacheMap<T> = std::sync::Mutex<BTreeMap<std::path::PathBuf, T>>;
type QueryDocument = graphql_parser::query::Document<'static, String>;
static SCHEMA_CACHE: CacheMap<Schema> = std::sync::Mutex::new(BTreeMap::new());
static QUERY_CACHE: CacheMap<(String, QueryDocument)> = std::sync::Mutex::new(BTreeMap::new());
fn get_set_cached<T: Clone>(
cache: &CacheMap<T>,
key: &std::path::Path,
value_func: impl FnOnce() -> T,