Struct spacetimedb_lib::type_def::ElementDef
source · pub struct ElementDef {
pub name: Option<String>,
pub algebraic_type: AlgebraicType,
}Expand description
NOTE: Each element has an implicit element tag based on its order. Uniquely identifies an element similarly to protobuf tags.
Fields§
§name: Option<String>§algebraic_type: AlgebraicTypeImplementations§
source§impl ProductTypeElement
impl ProductTypeElement
pub fn new( algebraic_type: AlgebraicType, name: Option<String> ) -> ProductTypeElement
pub fn new_named( algebraic_type: AlgebraicType, name: impl Into<String> ) -> ProductTypeElement
source§impl ProductTypeElement
impl ProductTypeElement
pub fn decode<'a>( bytes: &mut impl BufReader<'a> ) -> Result<ProductTypeElement, DecodeError>
pub fn encode(&self, bytes: &mut impl BufWriter)
Trait Implementations§
source§impl Clone for ProductTypeElement
impl Clone for ProductTypeElement
source§fn clone(&self) -> ProductTypeElement
fn clone(&self) -> ProductTypeElement
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 ProductTypeElement
impl Debug for ProductTypeElement
source§impl<'de> Deserialize<'de> for ProductTypeElement
impl<'de> Deserialize<'de> for ProductTypeElement
fn deserialize<D>( deserializer: D ) -> Result<ProductTypeElement, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
source§impl FromIterator<ProductTypeElement> for ProductType
impl FromIterator<ProductTypeElement> for ProductType
source§fn from_iter<T>(iter: T) -> ProductTypewhere
T: IntoIterator<Item = ProductTypeElement>,
fn from_iter<T>(iter: T) -> ProductTypewhere T: IntoIterator<Item = ProductTypeElement>,
Creates a value from an iterator. Read more
source§impl Ord for ProductTypeElement
impl Ord for ProductTypeElement
source§fn cmp(&self, other: &ProductTypeElement) -> Ordering
fn cmp(&self, other: &ProductTypeElement) -> 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<ProductTypeElement> for ProductTypeElement
impl PartialEq<ProductTypeElement> for ProductTypeElement
source§fn eq(&self, other: &ProductTypeElement) -> bool
fn eq(&self, other: &ProductTypeElement) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd<ProductTypeElement> for ProductTypeElement
impl PartialOrd<ProductTypeElement> for ProductTypeElement
source§fn partial_cmp(&self, other: &ProductTypeElement) -> Option<Ordering>
fn partial_cmp(&self, other: &ProductTypeElement) -> 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 ProductTypeElement
impl Serialize for ProductTypeElement
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