pub struct SerializedValues { /* private fields */ }
Expand description
A buffer containing already serialized values.
It is not aware of the types of contained values,
it is basically a byte buffer in the format expected by the CQL protocol.
Usually there is no need for a user of a driver to use this struct, it is mostly internal.
The exception are APIs like ClusterData::compute_token
/ ClusterData::get_endpoints
.
Allows adding new values to the buffer and iterating over the content.
Implementations§
Source§impl SerializedValues
impl SerializedValues
Sourcepub const EMPTY: &'static SerializedValues
pub const EMPTY: &'static SerializedValues
A const empty instance, useful for taking references
Sourcepub fn from_serializable<T: SerializeRow>(
ctx: &RowSerializationContext<'_>,
row: &T,
) -> Result<Self, SerializationError>
pub fn from_serializable<T: SerializeRow>( ctx: &RowSerializationContext<'_>, row: &T, ) -> Result<Self, SerializationError>
Constructs SerializedValues
from given SerializeRow
object.
Sourcepub fn from_closure<F, R>(f: F) -> Result<(Self, R), SerializationError>
pub fn from_closure<F, R>(f: F) -> Result<(Self, R), SerializationError>
Constructs SerializedValues
via given closure.
Sourcepub fn iter(&self) -> impl Iterator<Item = RawValue<'_>>
pub fn iter(&self) -> impl Iterator<Item = RawValue<'_>>
Returns an iterator over the values serialized into the object so far.
Sourcepub fn element_count(&self) -> u16
pub fn element_count(&self) -> u16
Returns the number of values written so far.
Sourcepub fn buffer_size(&self) -> usize
pub fn buffer_size(&self) -> usize
Returns the total serialized size of the values written so far.
Sourcepub fn add_value<T: SerializeCql>(
&mut self,
val: &T,
typ: &ColumnType,
) -> Result<(), SerializationError>
pub fn add_value<T: SerializeCql>( &mut self, val: &T, typ: &ColumnType, ) -> Result<(), SerializationError>
Serializes value and appends it to the list
Trait Implementations§
Source§impl Clone for SerializedValues
impl Clone for SerializedValues
Source§fn clone(&self) -> SerializedValues
fn clone(&self) -> SerializedValues
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more