Struct scylla::serialize::row::SerializedValues
source · 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 fn new() -> SerializedValues
pub const fn new() -> SerializedValues
Constructs a new, empty SerializedValues
.
sourcepub const EMPTY: &'static SerializedValues = _
pub const EMPTY: &'static SerializedValues = _
A const empty instance, useful for taking references
sourcepub fn from_serializable<T>(
ctx: &RowSerializationContext<'_>,
row: &T,
) -> Result<SerializedValues, SerializationError>where
T: SerializeRow,
pub fn from_serializable<T>(
ctx: &RowSerializationContext<'_>,
row: &T,
) -> Result<SerializedValues, SerializationError>where
T: SerializeRow,
Constructs SerializedValues
from given SerializeRow
object.
sourcepub fn from_closure<F, R>(
f: F,
) -> Result<(SerializedValues, R), SerializationError>
pub fn from_closure<F, R>( f: F, ) -> Result<(SerializedValues, 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>(
&mut self,
val: &T,
typ: &ColumnType<'_>,
) -> Result<(), SerializationError>where
T: SerializeValue,
pub fn add_value<T>(
&mut self,
val: &T,
typ: &ColumnType<'_>,
) -> Result<(), SerializationError>where
T: SerializeValue,
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 moresource§impl Debug for SerializedValues
impl Debug for SerializedValues
source§impl Default for SerializedValues
impl Default for SerializedValues
source§fn default() -> SerializedValues
fn default() -> SerializedValues
source§impl Ord for SerializedValues
impl Ord for SerializedValues
source§fn cmp(&self, other: &SerializedValues) -> Ordering
fn cmp(&self, other: &SerializedValues) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for SerializedValues
impl PartialEq for SerializedValues
source§fn eq(&self, other: &SerializedValues) -> bool
fn eq(&self, other: &SerializedValues) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for SerializedValues
impl PartialOrd for SerializedValues
source§fn partial_cmp(&self, other: &SerializedValues) -> Option<Ordering>
fn partial_cmp(&self, other: &SerializedValues) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for SerializedValues
impl StructuralPartialEq for SerializedValues
Auto Trait Implementations§
impl Freeze for SerializedValues
impl RefUnwindSafe for SerializedValues
impl Send for SerializedValues
impl Sync for SerializedValues
impl Unpin for SerializedValues
impl UnwindSafe for SerializedValues
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more