Struct kotlin_poet_rs::spec::CompanionObject
source · pub struct CompanionObject { /* private fields */ }
Expand description
Companion object for class Can contain properties, functions, subclasses and init blocks like class itself.
Implementations§
source§impl CompanionObject
impl CompanionObject
pub fn new() -> Self
sourcepub fn init<CodeBlockLike: Into<CodeBlock>>(self, block: CodeBlockLike) -> Self
pub fn init<CodeBlockLike: Into<CodeBlock>>(self, block: CodeBlockLike) -> Self
Adds an init block to the companion object
sourcepub fn visibility_modifier(
self,
visibility_modifier: VisibilityModifier,
) -> Self
pub fn visibility_modifier( self, visibility_modifier: VisibilityModifier, ) -> Self
Sets the visibility modifier for the companion object
Trait Implementations§
source§impl Clone for CompanionObject
impl Clone for CompanionObject
source§fn clone(&self) -> CompanionObject
fn clone(&self) -> CompanionObject
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 moresource§impl Debug for CompanionObject
impl Debug for CompanionObject
source§impl RenderKotlin for CompanionObject
impl RenderKotlin for CompanionObject
source§fn render_string(&self) -> String
fn render_string(&self) -> String
Shortcut method for converting RenderKotlin::render_into output into String.
Auto Trait Implementations§
impl Freeze for CompanionObject
impl RefUnwindSafe for CompanionObject
impl Send for CompanionObject
impl Sync for CompanionObject
impl Unpin for CompanionObject
impl UnwindSafe for CompanionObject
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
)