You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`DeserializeRow` requires two types of data in order to perform
deserialization:
1) a reference to the CQL frame (a FrameSlice),
2) a slice of specifications of all columns in the row, being part of
the ResultMetadata.
It's important to understand what is a _deserialized row_. It's not
just an implementor of DeserializeRow; there are some implementors of
`DeserializeRow` who are not yet final rows, but **partially**
deserialized types that support further deserialization - _row
deserializers_, such as `ColumnIterator`.
_Row deserializers_, as they still need to deserialize some row, are
naturally bound by 'metadata lifetime. However, _rows_ are completely
deserialized, so they should not be bound by 'metadata - only by 'frame.
When deserializing owned rows, both the frame and the metadata can have
any lifetime and it's not important. When deserializing borrowing rows,
however, they borrow from the frame, so their lifetime must necessarily
be bound by the lifetime of the frame. Metadata is only needed for the
deserialization, so its lifetime does not abstractly bound the
deserialized row.
Up to this commit, DeserializeRow was only parametrized by one lifetime:
'frame, which bounded both the frame slice and the metadata. (why?
the reason is the same as in DeserializeValue - see the previous commit)
This was done that way due to an assumption that both the metadata and
the frame (shared using Bytes) will be owned by the same entity.
However, the new idea of deserializing result metadata to a borrowed
form (to save allocations) makes result metadata's lifetime shorter than
the frame's lifetime. Not to unnecessarily shorten the deserialized
values' lifetime, a separate lifetime parameter is introduced for
result metadata: 'metadata.
The commit is large, but the changes are mostly mechanical, by adding
the second lifetime parameter.
RowIterator and TypedRowIterator are going to get the second lifetime
parameter, too, but for now they pass 'frame as both lifetime parameters
of DeserializeRow.
<#required_fields_deserializers as #macro_internal::DeserializeValue<#constraint_lifetime, #constraint_lifetime>>::type_check(#required_fields_idents.typ())
245
+
<#required_fields_deserializers as #macro_internal::DeserializeValue<#frame_lifetime, #metadata_lifetime>>::type_check(#required_fields_idents.typ())
0 commit comments