@@ -14,8 +14,8 @@ use crate::scalar::ScalarValue;
1414
1515/// The public API for defining new extension types.
1616///
17- /// This is the non-object-safe trait that plugin authors implement to define a new extension
18- /// type. It specifies the type's identity, metadata, serialization, and validation.
17+ /// This is the non-object-safe trait that plugin authors implement to define a new extension type.
18+ /// It specifies the type's identity, metadata, serialization, and validation.
1919pub trait ExtVTable : ' static + Sized + Send + Sync + Clone + Debug + Eq + Hash {
2020 /// Associated type containing the deserialized metadata for this extension type.
2121 type Metadata : ' static + Send + Sync + Clone + Debug + Display + Eq + Hash ;
@@ -39,26 +39,27 @@ pub trait ExtVTable: 'static + Sized + Send + Sync + Clone + Debug + Eq + Hash {
3939 /// Validate that the given storage type is compatible with this extension type.
4040 fn validate_dtype ( ext_dtype : & ExtDType < Self > ) -> VortexResult < ( ) > ;
4141
42- /// Can a value of `other` be implicitly widened into this type?
43- /// e.g. GeographyType might accept Point, LineString, etc.
42+ /// Can a value of `other` be implicitly widened into this type? (e.g. GeographyType might
43+ /// accept Point, LineString, etc.)
4444 ///
45- /// Implementors only need to override one of `can_coerce_from` or `can_coerce_to` — both
46- /// exist so that either side of the coercion can provide the logic.
45+ /// Implementors only need to override one of `can_coerce_from` or `can_coerce_to`. We have both
46+ /// so that either side of the coercion can provide the logic.
4747 fn can_coerce_from ( ext_dtype : & ExtDType < Self > , other : & DType ) -> bool {
4848 let _ = ( ext_dtype, other) ;
4949 false
5050 }
5151
5252 /// Can this type be implicitly widened into `other`?
5353 ///
54- /// Implementors only need to override one of `can_coerce_from` or `can_coerce_to` — both
55- /// exist so that either side of the coercion can provide the logic.
54+ /// Implementors only need to override one of `can_coerce_from` or `can_coerce_to`. We have both
55+ /// so that either side of the coercion can provide the logic.
5656 fn can_coerce_to ( ext_dtype : & ExtDType < Self > , other : & DType ) -> bool {
5757 let _ = ( ext_dtype, other) ;
5858 false
5959 }
6060
6161 /// Given two types in a Uniform context, what is their least supertype?
62+ ///
6263 /// Return None if no supertype exists.
6364 fn least_supertype ( ext_dtype : & ExtDType < Self > , other : & DType ) -> Option < DType > {
6465 let _ = ( ext_dtype, other) ;
@@ -69,7 +70,8 @@ pub trait ExtVTable: 'static + Sized + Send + Sync + Clone + Debug + Eq + Hash {
6970
7071 /// Validate the given storage value is compatible with the extension type.
7172 ///
72- /// By default, this calls [`unpack_native()`](ExtVTable::unpack_native) and discards the result.
73+ /// By default, this calls [`unpack_native()`](ExtVTable::unpack_native) and discards the
74+ /// result.
7375 ///
7476 /// # Errors
7577 ///
0 commit comments