当我尝试编译这段代码时:
编译器报错。
impl<S, V> Storage for Database<S>
where
S: StoredElement,
V: VisibleElement,
编译器报错。
error[E0207]: the type parameter `V` is not constrained by the impl trait, self type, or predicates
--> src/main.rs:77:9
|
77 | impl<S, V> Storage for Database<S>
| ^ unconstrained type parameter
我曾认为V: VisibleElement
是一个谓词,但显然编译器并不这样认为。
那么,在Rust中,什么是谓词呢?