Trait scylla::serialize::row::SerializeRow
source · pub trait SerializeRow {
// Required methods
fn serialize(
&self,
ctx: &RowSerializationContext<'_>,
writer: &mut RowWriter<'_>,
) -> Result<(), SerializationError>;
fn is_empty(&self) -> bool;
}
Expand description
Represents a set of values that can be sent along a CQL statement.
This is a low-level trait that is exposed to the specifics to the CQL protocol and usually does not have to be implemented directly. See the chapter on “Query Values” in the driver docs for information about how this trait is supposed to be used.
Required Methods§
sourcefn serialize(
&self,
ctx: &RowSerializationContext<'_>,
writer: &mut RowWriter<'_>,
) -> Result<(), SerializationError>
fn serialize( &self, ctx: &RowSerializationContext<'_>, writer: &mut RowWriter<'_>, ) -> Result<(), SerializationError>
Serializes the row according to the information in the given context.
It’s the trait’s responsibility to produce values in the order as specified in given serialization context.
sourcefn is_empty(&self) -> bool
fn is_empty(&self) -> bool
Returns whether this row contains any values or not.
This method is used before executing a simple statement in order to check whether there are any values provided to it. If there are some, then the query will be prepared first in order to obtain information about the bind marker types and names so that the values can be properly type checked and serialized.