#[non_exhaustive]pub enum UniversalOr<T>where
T: StructFieldType,{
Specific(Handle<Struct<T, Unvalidated>>),
Universal(UniversalStructHandle),
}
Expand description
Structs can always be the Universal struct type, but may also be a more specific type depending on context
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Specific(Handle<Struct<T, Unvalidated>>)
Universal(UniversalStructHandle)
Implementations§
Source§impl<T> UniversalOr<T>where
T: StructFieldType,
impl<T> UniversalOr<T>where
T: StructFieldType,
pub fn name(&self) -> &Name
pub fn declaration(&self) -> StructDeclarationHandle
pub fn typed_declaration(&self) -> UniversalDeclarationOr<T>
pub fn to_struct_type(&self) -> StructType<Unvalidated>
Trait Implementations§
Source§impl<T> Clone for UniversalOr<T>where
T: StructFieldType + Clone,
impl<T> Clone for UniversalOr<T>where
T: StructFieldType + Clone,
Source§fn clone(&self) -> UniversalOr<T>
fn clone(&self) -> UniversalOr<T>
Returns a duplicate 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<T> Debug for UniversalOr<T>where
T: StructFieldType + Debug,
impl<T> Debug for UniversalOr<T>where
T: StructFieldType + Debug,
Source§impl<T> From<Handle<Struct<T, Unvalidated>>> for UniversalOr<T>where
T: StructFieldType,
impl<T> From<Handle<Struct<T, Unvalidated>>> for UniversalOr<T>where
T: StructFieldType,
Source§impl From<UniversalOr<FunctionReturnStructField>> for IteratorItemType
impl From<UniversalOr<FunctionReturnStructField>> for IteratorItemType
Source§fn from(x: UniversalOr<FunctionReturnStructField>) -> Self
fn from(x: UniversalOr<FunctionReturnStructField>) -> Self
Converts to this type from the input type.
Source§impl<T> InitializerValidator for UniversalOr<T>where
T: StructFieldType,
impl<T> InitializerValidator for UniversalOr<T>where
T: StructFieldType,
Source§fn validate_default_value(
&self,
value: &InitializerDefault,
) -> BindResult<ValidatedDefaultValue>
fn validate_default_value( &self, value: &InitializerDefault, ) -> BindResult<ValidatedDefaultValue>
Check that the value is valid for the type
fn bad_initializer_value( field_type: String, value: &InitializerDefault, ) -> BindResult<ValidatedDefaultValue>
Source§impl<T> PartialEq for UniversalOr<T>where
T: StructFieldType,
impl<T> PartialEq for UniversalOr<T>where
T: StructFieldType,
impl<T> Eq for UniversalOr<T>where
T: StructFieldType + Eq,
Auto Trait Implementations§
impl<T> Freeze for UniversalOr<T>
impl<T> RefUnwindSafe for UniversalOr<T>where
T: RefUnwindSafe,
impl<T> !Send for UniversalOr<T>
impl<T> !Sync for UniversalOr<T>
impl<T> Unpin for UniversalOr<T>
impl<T> UnwindSafe for UniversalOr<T>where
T: RefUnwindSafe,
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