pub enum TypeParameter {
Concrete(String),
Parametric(Box<ParametricType>),
}Expand description
A type parameter that can be either a concrete type or another parametric type.
Variants§
Concrete(String)
A concrete type name (e.g., “Person”, “Int”)
Parametric(Box<ParametricType>)
A nested parametric type (e.g., List<Option<Person>>)
Implementations§
Source§impl TypeParameter
impl TypeParameter
Sourcepub fn parametric(ptype: ParametricType) -> Self
pub fn parametric(ptype: ParametricType) -> Self
Creates a parametric type parameter.
Sourcepub fn as_concrete(&self) -> Option<&str>
pub fn as_concrete(&self) -> Option<&str>
Returns the name if this is a concrete type parameter.
Sourcepub fn as_parametric(&self) -> Option<&ParametricType>
pub fn as_parametric(&self) -> Option<&ParametricType>
Returns the parametric type if this is a parametric type parameter.
Trait Implementations§
Source§impl Clone for TypeParameter
impl Clone for TypeParameter
Source§fn clone(&self) -> TypeParameter
fn clone(&self) -> TypeParameter
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 Debug for TypeParameter
impl Debug for TypeParameter
Source§impl<'de> Deserialize<'de> for TypeParameter
impl<'de> Deserialize<'de> for TypeParameter
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for TypeParameter
impl Display for TypeParameter
Source§impl Hash for TypeParameter
impl Hash for TypeParameter
Source§impl PartialEq for TypeParameter
impl PartialEq for TypeParameter
Source§impl Serialize for TypeParameter
impl Serialize for TypeParameter
impl Eq for TypeParameter
impl StructuralPartialEq for TypeParameter
Auto Trait Implementations§
impl Freeze for TypeParameter
impl RefUnwindSafe for TypeParameter
impl Send for TypeParameter
impl Sync for TypeParameter
impl Unpin for TypeParameter
impl UnwindSafe for TypeParameter
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.