File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,14 @@ impl SequenceValueTypeMarker for DynSequenceValueType {
3030 crate :: private_impl!( ) ;
3131}
3232
33+ impl DowncastableTarget for DynSequenceValueType {
34+ fn can_downcast ( dtype : & ValueType ) -> bool {
35+ matches ! ( dtype, ValueType :: Sequence { .. } )
36+ }
37+
38+ crate :: private_impl!( ) ;
39+ }
40+
3341#[ derive( Debug ) ]
3442pub struct SequenceValueType < T : ValueTypeMarker + DowncastableTarget + Debug + ?Sized > ( PhantomData < T > ) ;
3543impl < T : ValueTypeMarker + DowncastableTarget + Debug + ?Sized > ValueTypeMarker for SequenceValueType < T > {
@@ -43,6 +51,17 @@ impl<T: ValueTypeMarker + DowncastableTarget + Debug + ?Sized> SequenceValueType
4351 crate :: private_impl!( ) ;
4452}
4553
54+ impl < T : ValueTypeMarker + DowncastableTarget + Debug + ?Sized > DowncastableTarget for SequenceValueType < T > {
55+ fn can_downcast ( dtype : & ValueType ) -> bool {
56+ match dtype {
57+ ValueType :: Sequence ( ty) => T :: can_downcast ( ty) ,
58+ _ => false
59+ }
60+ }
61+
62+ crate :: private_impl!( ) ;
63+ }
64+
4665pub type DynSequence = Value < DynSequenceValueType > ;
4766pub type Sequence < T > = Value < SequenceValueType < T > > ;
4867
You can’t perform that action at this time.
0 commit comments