|
2 | 2 | //! |
3 | 3 | //! Deserialization is based on two traits: |
4 | 4 | //! |
5 | | -//! - A type that implements `DeserializeValue<'frame>` can be deserialized |
| 5 | +//! - A type that implements `DeserializeValue<'frame, 'metadata>` can be deserialized |
6 | 6 | //! from a single _CQL value_ - i.e. an element of a row in the query result, |
7 | 7 | //! - A type that implements `DeserializeRow<'frame>` can be deserialized |
8 | 8 | //! from a single _row_ of a query result. |
|
57 | 57 | //! #[error("Expected non-null")] |
58 | 58 | //! ExpectedNonNull, |
59 | 59 | //! } |
60 | | -//! impl<'frame> DeserializeValue<'frame> for MyVec { |
| 60 | +//! impl<'frame, 'metadata> DeserializeValue<'frame, 'metadata> for MyVec { |
61 | 61 | //! fn type_check(typ: &ColumnType) -> Result<(), TypeCheckError> { |
62 | 62 | //! if let ColumnType::Blob = typ { |
63 | 63 | //! return Ok(()); |
|
66 | 66 | //! } |
67 | 67 | //! |
68 | 68 | //! fn deserialize( |
69 | | -//! _typ: &'frame ColumnType, |
| 69 | +//! _typ: &'metadata ColumnType<'metadata>, |
70 | 70 | //! v: Option<FrameSlice<'frame>>, |
71 | 71 | //! ) -> Result<Self, DeserializationError> { |
72 | 72 | //! v.ok_or_else(|| DeserializationError::new(MyDeserError::ExpectedNonNull)) |
|
98 | 98 | //! #[error("Expected non-null")] |
99 | 99 | //! ExpectedNonNull, |
100 | 100 | //! } |
101 | | -//! impl<'a, 'frame> DeserializeValue<'frame> for MySlice<'a> |
| 101 | +//! impl<'a, 'frame, 'metadata> DeserializeValue<'frame, 'metadata> for MySlice<'a> |
102 | 102 | //! where |
103 | 103 | //! 'frame: 'a, |
104 | 104 | //! { |
|
110 | 110 | //! } |
111 | 111 | //! |
112 | 112 | //! fn deserialize( |
113 | | -//! _typ: &'frame ColumnType, |
| 113 | +//! _typ: &'metadata ColumnType<'metadata>, |
114 | 114 | //! v: Option<FrameSlice<'frame>>, |
115 | 115 | //! ) -> Result<Self, DeserializationError> { |
116 | 116 | //! v.ok_or_else(|| DeserializationError::new(MyDeserError::ExpectedNonNull)) |
|
150 | 150 | //! #[error("Expected non-null")] |
151 | 151 | //! ExpectedNonNull, |
152 | 152 | //! } |
153 | | -//! impl<'frame> DeserializeValue<'frame> for MyBytes { |
| 153 | +//! impl<'frame, 'metadata> DeserializeValue<'frame, 'metadata> for MyBytes { |
154 | 154 | //! fn type_check(typ: &ColumnType) -> Result<(), TypeCheckError> { |
155 | 155 | //! if let ColumnType::Blob = typ { |
156 | 156 | //! return Ok(()); |
|
159 | 159 | //! } |
160 | 160 | //! |
161 | 161 | //! fn deserialize( |
162 | | -//! _typ: &'frame ColumnType, |
| 162 | +//! _typ: &'metadata ColumnType<'metadata>, |
163 | 163 | //! v: Option<FrameSlice<'frame>>, |
164 | 164 | //! ) -> Result<Self, DeserializationError> { |
165 | 165 | //! v.ok_or_else(|| DeserializationError::new(MyDeserError::ExpectedNonNull)) |
|
0 commit comments