pub struct GenericParameter { /* private fields */ }
Expand description
Describes a generic parameter of a class or function.
Note, because crate::io::RenderKotlin implementation for this struct would be ambiguous, it is not implemented.
Implementations§
Source§impl GenericParameter
impl GenericParameter
Sourcepub fn new<NameLike: Into<Name>>(name: NameLike) -> Self
pub fn new<NameLike: Into<Name>>(name: NameLike) -> Self
Creates new GenericParameter with a given name, no invariance modifier or type boundaries.
Sourcepub fn invariance(self, invariance: GenericInvariance) -> Self
pub fn invariance(self, invariance: GenericInvariance) -> Self
Sets GenericInvariance. Should not be used with function generic parameters.
Sourcepub fn type_boundary<TypeLike: Into<Type>>(self, boundary: TypeLike) -> Self
pub fn type_boundary<TypeLike: Into<Type>>(self, boundary: TypeLike) -> Self
Adds new type boundary to the generic parameter. This method could be called multiple times to add multiple type boundaries.
Trait Implementations§
Source§impl Clone for GenericParameter
impl Clone for GenericParameter
Source§fn clone(&self) -> GenericParameter
fn clone(&self) -> GenericParameter
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 moreAuto Trait Implementations§
impl Freeze for GenericParameter
impl RefUnwindSafe for GenericParameter
impl Send for GenericParameter
impl Sync for GenericParameter
impl Unpin for GenericParameter
impl UnwindSafe for GenericParameter
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