Struct kotlin_poet_rs::spec::GenericParameter
source · 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.
pub fn reified(self, flag: bool) -> Self
Trait Implementations§
source§impl Clone for GenericParameter
impl Clone for GenericParameter
source§fn clone(&self) -> GenericParameter
fn clone(&self) -> GenericParameter
Returns a copy 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)