Struct spacetimedb_lib::ProductValue
source · pub struct ProductValue {
pub elements: Vec<AlgebraicValue, Global>,
}
Fields§
§elements: Vec<AlgebraicValue, Global>
Implementations§
source§impl ProductValue
impl ProductValue
pub fn new(elements: &[AlgebraicValue]) -> ProductValue
source§impl ProductValue
impl ProductValue
pub fn get_field( &self, index: usize, named: Option<&'static str> ) -> Result<&AlgebraicValue, InvalidFieldError>
pub fn extract_field<'a, T, F>( &'a self, index: usize, named: Option<&'static str>, f: F ) -> Result<T, InvalidFieldError>where F: Fn(&'a AlgebraicValue) -> Option<T> + 'a,
pub fn field_as_bool( &self, index: usize, named: Option<&'static str> ) -> Result<bool, InvalidFieldError>
pub fn field_as_u8( &self, index: usize, named: Option<&'static str> ) -> Result<u8, InvalidFieldError>
pub fn field_as_u32( &self, index: usize, named: Option<&'static str> ) -> Result<u32, InvalidFieldError>
pub fn field_as_i64( &self, index: usize, named: Option<&'static str> ) -> Result<i64, InvalidFieldError>
pub fn field_as_i128( &self, index: usize, named: Option<&'static str> ) -> Result<i128, InvalidFieldError>
pub fn field_as_u128( &self, index: usize, named: Option<&'static str> ) -> Result<u128, InvalidFieldError>
pub fn field_as_str( &self, index: usize, named: Option<&'static str> ) -> Result<&str, InvalidFieldError>
pub fn field_as_bytes( &self, index: usize, named: Option<&'static str> ) -> Result<&[u8], InvalidFieldError>
source§impl ProductValue
impl ProductValue
pub fn decode<'a>( algebraic_type: &<ProductValue as Value>::Type, bytes: &mut impl BufReader<'a> ) -> Result<ProductValue, DecodeError>
pub fn encode(&self, bytes: &mut impl BufWriter)
Trait Implementations§
source§impl Clone for ProductValue
impl Clone for ProductValue
source§fn clone(&self) -> ProductValue
fn clone(&self) -> ProductValue
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ProductValue
impl Debug for ProductValue
source§impl From<&AlgebraicValue> for ProductValue
impl From<&AlgebraicValue> for ProductValue
source§fn from(x: &AlgebraicValue) -> ProductValue
fn from(x: &AlgebraicValue) -> ProductValue
Converts to this type from the input type.
source§impl From<AlgebraicValue> for ProductValue
impl From<AlgebraicValue> for ProductValue
source§fn from(x: AlgebraicValue) -> ProductValue
fn from(x: AlgebraicValue) -> ProductValue
Converts to this type from the input type.
source§impl From<ProductValue> for AlgebraicValue
impl From<ProductValue> for AlgebraicValue
source§fn from(x: ProductValue) -> AlgebraicValue
fn from(x: ProductValue) -> AlgebraicValue
Converts to this type from the input type.
source§impl FromIterator<AlgebraicValue> for ProductValue
impl FromIterator<AlgebraicValue> for ProductValue
source§fn from_iter<T>(iter: T) -> ProductValuewhere
T: IntoIterator<Item = AlgebraicValue>,
fn from_iter<T>(iter: T) -> ProductValuewhere T: IntoIterator<Item = AlgebraicValue>,
Creates a value from an iterator. Read more
source§impl Hash for ProductValue
impl Hash for ProductValue
source§impl Ord for ProductValue
impl Ord for ProductValue
source§fn cmp(&self, other: &ProductValue) -> Ordering
fn cmp(&self, other: &ProductValue) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<ProductValue> for ProductValue
impl PartialEq<ProductValue> for ProductValue
source§fn eq(&self, other: &ProductValue) -> bool
fn eq(&self, other: &ProductValue) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ProductValue> for ProductValue
impl PartialOrd<ProductValue> for ProductValue
source§fn partial_cmp(&self, other: &ProductValue) -> Option<Ordering>
fn partial_cmp(&self, other: &ProductValue) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for ProductValue
impl Serialize for ProductValue
source§fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl Serialize for ProductValue
impl Serialize for ProductValue
fn serialize<S>( &self, serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
source§impl ToDataKey for ProductValue
impl ToDataKey for ProductValue
fn to_data_key(&self) -> DataKey
source§impl Value for ProductValue
impl Value for ProductValue
type Type = ProductType
impl Eq for ProductValue
impl StructuralEq for ProductValue
impl StructuralPartialEq for ProductValue
Auto Trait Implementations§
impl RefUnwindSafe for ProductValue
impl Send for ProductValue
impl Sync for ProductValue
impl Unpin for ProductValue
impl UnwindSafe for ProductValue
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