Enum kotlin_poet_rs::spec::Import
source · pub enum Import {
ClassLikeType {
type_name: ClassLikeTypeName,
alias: Option<Name>,
},
Projection(Package),
TopLevel {
package: Package,
name: Name,
},
}
Expand description
Defines Kotlin’s import statement
Variants§
ClassLikeType
Import a class-like type possibly aliased with a different name
Projection(Package)
Import of all types from a package
TopLevel
Import of function / property
Implementations§
source§impl Import
impl Import
sourcepub fn class_like<ClassLikeTypeNameLike: Into<ClassLikeTypeName>>(
type_name: ClassLikeTypeNameLike,
) -> Self
pub fn class_like<ClassLikeTypeNameLike: Into<ClassLikeTypeName>>( type_name: ClassLikeTypeNameLike, ) -> Self
Creates an import statement for a class-like type
sourcepub fn class_like_alias<NameLike: Into<Name>, ClassLikeTypeNameLike: Into<ClassLikeTypeName>>(
type_name: ClassLikeTypeNameLike,
alias: NameLike,
) -> Self
pub fn class_like_alias<NameLike: Into<Name>, ClassLikeTypeNameLike: Into<ClassLikeTypeName>>( type_name: ClassLikeTypeNameLike, alias: NameLike, ) -> Self
Creates an import statement for a class-like type with an alias
sourcepub fn projection<PackageLike: Into<Package>>(package: PackageLike) -> Self
pub fn projection<PackageLike: Into<Package>>(package: PackageLike) -> Self
Creates an import statement for all types in a package
Trait Implementations§
source§impl RenderKotlin for Import
impl RenderKotlin for Import
source§fn render_string(&self) -> String
fn render_string(&self) -> String
Shortcut method for converting RenderKotlin::render_into output into String.
impl StructuralPartialEq for Import
Auto Trait Implementations§
impl Freeze for Import
impl RefUnwindSafe for Import
impl Send for Import
impl Sync for Import
impl Unpin for Import
impl UnwindSafe for Import
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
)