Struct spacetimedb_lib::type_def::SumType
source · pub struct SumType {
pub variants: Vec<SumTypeVariant, Global>,
}Fields§
§variants: Vec<SumTypeVariant, Global>Implementations§
source§impl SumType
impl SumType
pub fn new(variants: Vec<SumTypeVariant, Global>) -> SumType
pub fn new_unnamed(types: Vec<AlgebraicType, Global>) -> SumType
pub fn looks_like_option(&self) -> Option<&AlgebraicType>
source§impl SumType
impl SumType
pub fn make_meta_type() -> AlgebraicType
pub fn as_value(&self) -> AlgebraicValue
pub fn from_value( value: &AlgebraicValue ) -> Result<SumType, ValueDeserializeError>
Trait Implementations§
source§impl<'de> Deserialize<'de> for SumType
impl<'de> Deserialize<'de> for SumType
fn deserialize<D>( deserializer: D ) -> Result<SumType, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
source§impl<'de> Deserialize<'de> for SumType
impl<'de> Deserialize<'de> for SumType
source§fn deserialize<D>(
deserializer: D
) -> Result<SumType, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<SumType, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for SumType
impl Ord for SumType
source§impl PartialEq<SumType> for SumType
impl PartialEq<SumType> for SumType
source§impl PartialOrd<SumType> for SumType
impl PartialOrd<SumType> for SumType
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 SumType
impl Serialize for SumType
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 SumType
impl Serialize for SumType
fn serialize<S>( &self, __serializer: S ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where S: Serializer,
impl Eq for SumType
impl StructuralEq for SumType
impl StructuralPartialEq for SumType
Auto Trait Implementations§
impl RefUnwindSafe for SumType
impl Send for SumType
impl Sync for SumType
impl Unpin for SumType
impl UnwindSafe for SumType
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