NestedValue new() method for easy wrapping

This commit is contained in:
Tony Garnock-Jones 2021-07-03 08:59:03 +02:00
parent c70035b044
commit 6143ddc93d
1 changed files with 4 additions and 0 deletions

View File

@ -40,6 +40,10 @@ impl<D: Domain> Domain for Arc<D> {
}
pub trait NestedValue<D: Embeddable>: Sized + Debug + Clone + Eq + Hash + Ord {
fn new<V>(v: V) -> Self where Value<Self, D>: From<V> {
Value::from(v).wrap()
}
fn wrap(anns: Annotations<Self, D>, v: Value<Self, D>) -> Self;
fn annotations(&self) -> &Annotations<Self, D>;