diff --git a/examples/hello_world/main.rs b/examples/hello_world/main.rs index 3e74c0e..5fbf33f 100644 --- a/examples/hello_world/main.rs +++ b/examples/hello_world/main.rs @@ -5,6 +5,16 @@ mod implementation; use self::class_table::ClassTableQueryContext; use self::implementation::QueryContextImpl; +#[test] +fn test() { + let query = QueryContextImpl::default(); + let all_def_ids = query.all_fields().of(()); + assert_eq!( + format!("{:?}", all_def_ids), + "[DefId(1), DefId(2), DefId(11), DefId(12)]" + ); +} + fn main() { let query = QueryContextImpl::default(); for f in query.all_fields().of(()).iter() { diff --git a/src/lib.rs b/src/lib.rs index d5f4ae5..7871c7d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -48,7 +48,7 @@ pub trait BaseQueryContext: Sized { pub trait Query: Debug + Default + Sized + 'static { type Key: Clone + Debug + Hash + Eq + Send; type Value: Clone + Debug + Hash + Eq + Send; - type Storage: QueryStorageOps; + type Storage: QueryStorageOps + Send; fn execute(query: &QC, key: Self::Key) -> Self::Value; }