pub struct GenericParametersWithDefaults { /* private fields */ }
Expand description
Represents a collection of generic parameters that may include default values.
Implementations§
Source§impl GenericParametersWithDefaults
impl GenericParametersWithDefaults
Sourcepub fn from_type_variable(identifier: impl Into<Identifier>) -> Self
pub fn from_type_variable(identifier: impl Into<Identifier>) -> Self
Creates new generic parameters with a single type variable.
Sourcepub fn from_type_variable_with_default(
type_variable_with_default: TypeVariableWithDefault,
) -> Self
pub fn from_type_variable_with_default( type_variable_with_default: TypeVariableWithDefault, ) -> Self
Creates new generic parameters with a single type variable that has a default value.
Sourcepub fn from_generic_type_pack(generic_type_pack: GenericTypePack) -> Self
pub fn from_generic_type_pack(generic_type_pack: GenericTypePack) -> Self
Creates new generic parameters with a single generic type pack.
Sourcepub fn from_generic_type_pack_with_default(
generic_type_pack_with_default: GenericTypePackWithDefault,
) -> Self
pub fn from_generic_type_pack_with_default( generic_type_pack_with_default: GenericTypePackWithDefault, ) -> Self
Creates new generic parameters with a single generic type pack that has a default value.
Sourcepub fn with_type_variable(self, identifier: impl Into<Identifier>) -> Self
pub fn with_type_variable(self, identifier: impl Into<Identifier>) -> Self
Adds a type variable to these generic parameters.
Sourcepub fn push_type_variable(&mut self, type_variable: impl Into<Identifier>)
pub fn push_type_variable(&mut self, type_variable: impl Into<Identifier>)
Adds a type variable to these generic parameters.
Sourcepub fn with_type_variable_with_default(
self,
type_variable_with_default: TypeVariableWithDefault,
) -> Option<Self>
pub fn with_type_variable_with_default( self, type_variable_with_default: TypeVariableWithDefault, ) -> Option<Self>
Adds a type variable with a default value to these generic parameters.
Returns None
if the operation would mix type variables with default values and generic type packs.
Sourcepub fn push_type_variable_with_default(
&mut self,
type_variable_with_default: TypeVariableWithDefault,
) -> bool
pub fn push_type_variable_with_default( &mut self, type_variable_with_default: TypeVariableWithDefault, ) -> bool
Adds a type variable with a default value to these generic parameters.
Returns false
if the operation would mix type variables with default values and generic type packs.
Sourcepub fn with_generic_type_pack(
self,
generic_type_pack: GenericTypePack,
) -> Option<Self>
pub fn with_generic_type_pack( self, generic_type_pack: GenericTypePack, ) -> Option<Self>
Adds a generic type pack to these generic parameters.
Returns None
if the operation would mix generic type packs and type variables with default values.
Sourcepub fn push_generic_type_pack(
&mut self,
generic_type_pack: GenericTypePack,
) -> bool
pub fn push_generic_type_pack( &mut self, generic_type_pack: GenericTypePack, ) -> bool
Adds a generic type pack to these generic parameters.
Returns false
if the operation would mix generic type packs and type variables with default values.
Sourcepub fn with_generic_type_pack_with_default(
self,
generic_type_pack_with_default: GenericTypePackWithDefault,
) -> Self
pub fn with_generic_type_pack_with_default( self, generic_type_pack_with_default: GenericTypePackWithDefault, ) -> Self
Adds a generic type pack with a default value to these generic parameters.
Sourcepub fn push_generic_type_pack_with_default(
&mut self,
generic_type_pack_with_default: GenericTypePackWithDefault,
)
pub fn push_generic_type_pack_with_default( &mut self, generic_type_pack_with_default: GenericTypePackWithDefault, )
Adds a generic type pack with a default value to these generic parameters.
Sourcepub fn with_tokens(self, tokens: GenericParametersTokens) -> Self
pub fn with_tokens(self, tokens: GenericParametersTokens) -> Self
Associates tokens with these generic parameters.
Sourcepub fn set_tokens(&mut self, tokens: GenericParametersTokens)
pub fn set_tokens(&mut self, tokens: GenericParametersTokens)
Sets the tokens associated with these generic parameters.
Sourcepub fn get_tokens(&self) -> Option<&GenericParametersTokens>
pub fn get_tokens(&self) -> Option<&GenericParametersTokens>
Returns the tokens associated with these generic parameters, if any.
Sourcepub fn iter(&self) -> impl Iterator<Item = GenericParameterRef<'_>>
pub fn iter(&self) -> impl Iterator<Item = GenericParameterRef<'_>>
Returns an iterator over references to the generic parameters.
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = GenericParameterMutRef<'_>>
pub fn iter_mut(&mut self) -> impl Iterator<Item = GenericParameterMutRef<'_>>
Returns a mutable iterator over references to the generic parameters.
Sourcepub fn clear_comments(&mut self)
pub fn clear_comments(&mut self)
Clears all comments from the tokens in this node.
Sourcepub fn clear_whitespaces(&mut self)
pub fn clear_whitespaces(&mut self)
Clears all whitespaces information from the tokens in this node.
Trait Implementations§
Source§impl Clone for GenericParametersWithDefaults
impl Clone for GenericParametersWithDefaults
Source§fn clone(&self) -> GenericParametersWithDefaults
fn clone(&self) -> GenericParametersWithDefaults
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'a> IntoIterator for &'a GenericParametersWithDefaults
impl<'a> IntoIterator for &'a GenericParametersWithDefaults
Source§type Item = GenericParameterRef<'a>
type Item = GenericParameterRef<'a>
Source§type IntoIter = GenericParameterIteratorGeneric<GenericParameterRef<'a>, &'a Identifier, &'a GenericTypePack, &'a TypeVariableWithDefault, &'a GenericTypePackWithDefault, Iter<'a, Identifier>, Iter<'a, GenericTypePack>, Iter<'a, TypeVariableWithDefault>, Iter<'a, GenericTypePackWithDefault>>
type IntoIter = GenericParameterIteratorGeneric<GenericParameterRef<'a>, &'a Identifier, &'a GenericTypePack, &'a TypeVariableWithDefault, &'a GenericTypePackWithDefault, Iter<'a, Identifier>, Iter<'a, GenericTypePack>, Iter<'a, TypeVariableWithDefault>, Iter<'a, GenericTypePackWithDefault>>
Source§impl<'a> IntoIterator for &'a mut GenericParametersWithDefaults
impl<'a> IntoIterator for &'a mut GenericParametersWithDefaults
Source§type Item = GenericParameterMutRef<'a>
type Item = GenericParameterMutRef<'a>
Source§type IntoIter = GenericParameterIteratorGeneric<GenericParameterMutRef<'a>, &'a mut Identifier, &'a mut GenericTypePack, &'a mut TypeVariableWithDefault, &'a mut GenericTypePackWithDefault, IterMut<'a, Identifier>, IterMut<'a, GenericTypePack>, IterMut<'a, TypeVariableWithDefault>, IterMut<'a, GenericTypePackWithDefault>>
type IntoIter = GenericParameterIteratorGeneric<GenericParameterMutRef<'a>, &'a mut Identifier, &'a mut GenericTypePack, &'a mut TypeVariableWithDefault, &'a mut GenericTypePackWithDefault, IterMut<'a, Identifier>, IterMut<'a, GenericTypePack>, IterMut<'a, TypeVariableWithDefault>, IterMut<'a, GenericTypePackWithDefault>>
Source§impl IntoIterator for GenericParametersWithDefaults
impl IntoIterator for GenericParametersWithDefaults
Source§type Item = GenericParameter
type Item = GenericParameter
Source§type IntoIter = GenericParameterIteratorGeneric<GenericParameter, Identifier, GenericTypePack, TypeVariableWithDefault, GenericTypePackWithDefault, IntoIter<Identifier>, IntoIter<GenericTypePack>, IntoIter<TypeVariableWithDefault>, IntoIter<GenericTypePackWithDefault>>
type IntoIter = GenericParameterIteratorGeneric<GenericParameter, Identifier, GenericTypePack, TypeVariableWithDefault, GenericTypePackWithDefault, IntoIter<Identifier>, IntoIter<GenericTypePack>, IntoIter<TypeVariableWithDefault>, IntoIter<GenericTypePackWithDefault>>
Source§impl PartialEq for GenericParametersWithDefaults
impl PartialEq for GenericParametersWithDefaults
Source§fn eq(&self, other: &GenericParametersWithDefaults) -> bool
fn eq(&self, other: &GenericParametersWithDefaults) -> bool
self
and other
values to be equal, and is used by ==
.impl Eq for GenericParametersWithDefaults
impl StructuralPartialEq for GenericParametersWithDefaults
Auto Trait Implementations§
impl Freeze for GenericParametersWithDefaults
impl RefUnwindSafe for GenericParametersWithDefaults
impl Send for GenericParametersWithDefaults
impl Sync for GenericParametersWithDefaults
impl Unpin for GenericParametersWithDefaults
impl UnwindSafe for GenericParametersWithDefaults
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
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
key
and return true
if they are equal.Source§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
Source§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Joinable for Twhere
&'a T: for<'a> IntoIterator,
impl<T> Joinable for Twhere
&'a T: for<'a> IntoIterator,
type Collection = T
Source§fn join_concat(self) -> Join<Self::Collection, NoSeparator>
fn join_concat(self) -> Join<Self::Collection, NoSeparator>
Display
, the underlying elements will be directly concatenated.
Note that the separator, while empty, is still present, and will show
up if you iterate this instance. Read more