Struct spacetimedb_sats::ValueWithType
source · pub struct ValueWithType<'a, T: Value> { /* private fields */ }
Expand description
A borrowed value combined with its type and typing context (Typespace
).
Implementations§
source§impl<'a> ValueWithType<'a, ProductValue>
impl<'a> ValueWithType<'a, ProductValue>
pub fn elements( &self, ) -> impl ExactSizeIterator<Item = ValueWithType<'a, AlgebraicValue>>
source§impl<'a, T: Value> ValueWithType<'a, T>
impl<'a, T: Value> ValueWithType<'a, T>
sourcepub fn new(ty: WithTypespace<'a, T::Type>, val: &'a T) -> Self
pub fn new(ty: WithTypespace<'a, T::Type>, val: &'a T) -> Self
Wraps the borrowed value val
with its type combined with context.
pub fn ty_s(&self) -> WithTypespace<'a, T::Type>
source§impl<'a, T: Value> ValueWithType<'a, Box<[T]>>
impl<'a, T: Value> ValueWithType<'a, Box<[T]>>
pub fn iter(&self) -> impl Iterator<Item = ValueWithType<'_, T>>
Trait Implementations§
source§impl<T: Value> Clone for ValueWithType<'_, T>
impl<T: Value> Clone for ValueWithType<'_, T>
source§impl Serialize for ValueWithType<'_, AlgebraicValue>
impl Serialize for ValueWithType<'_, AlgebraicValue>
source§impl Serialize for ValueWithType<'_, ArrayValue>
impl Serialize for ValueWithType<'_, ArrayValue>
source§impl Serialize for ValueWithType<'_, MapValue>
impl Serialize for ValueWithType<'_, MapValue>
source§impl<T: Value> Serialize for ValueWithType<'_, Box<[T]>>where
for<'a> ValueWithType<'a, T>: Serialize,
impl<T: Value> Serialize for ValueWithType<'_, Box<[T]>>where
for<'a> ValueWithType<'a, T>: Serialize,
source§impl Serialize for ValueWithType<'_, ProductValue>
impl Serialize for ValueWithType<'_, ProductValue>
source§impl Serialize for ValueWithType<'_, SumValue>
impl Serialize for ValueWithType<'_, SumValue>
impl<T: Value> Copy for ValueWithType<'_, T>
Auto Trait Implementations§
impl<'a, T> Freeze for ValueWithType<'a, T>
impl<'a, T> RefUnwindSafe for ValueWithType<'a, T>
impl<'a, T> Send for ValueWithType<'a, T>
impl<'a, T> Sync for ValueWithType<'a, T>
impl<'a, T> Unpin for ValueWithType<'a, T>
impl<'a, T> UnwindSafe for ValueWithType<'a, T>
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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>
Converts
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>
Converts
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 moresource§impl<T> Satn for T
impl<T> Satn for T
source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the value using the SATN data format into the formatter
f
.source§fn fmt_psql(&self, f: &mut Formatter<'_>, ty: &ProductType) -> Result
fn fmt_psql(&self, f: &mut Formatter<'_>, ty: &ProductType) -> Result
Formats the value using the postgres SATN(SatnFormatter { f }, /* AlgebraicType */) formatter
f
.source§fn to_satn(&self) -> String
fn to_satn(&self) -> String
Formats the value using the SATN data format into the returned
String
.source§fn to_satn_pretty(&self) -> String
fn to_satn_pretty(&self) -> String
Pretty prints the value using the SATN data format into the returned
String
.