pub trait QueryParameter:
Sized
+ Clone
+ 'static {
// Required method
fn hash_stable(&self, hasher: &mut QueryHasher);
// Provided method
fn get_clone<'cx>( ) -> for<'a> fn(this: TypeErasedQueryParam<'cx>, _: &'a Storage) -> TypeErasedQueryParam<'a>
where Self: 'cx { ... }
}
Expand description
Query parameters should be hashable and clonable.
The hash infrastructure is part of this trait itself, because it’s not unlikely you want to hash the elements you pass into queries in a different way than they are hashed by default.
Required Methods§
fn hash_stable(&self, hasher: &mut QueryHasher)
Provided Methods§
fn get_clone<'cx>() -> for<'a> fn(this: TypeErasedQueryParam<'cx>, _: &'a Storage) -> TypeErasedQueryParam<'a>where
Self: 'cx,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.