Struct kotlin_poet_rs::spec::Property
source · pub struct Property { /* private fields */ }
Expand description
Represents a Kotlin property
Implementations§
source§impl Property
impl Property
pub fn new<NameLike: Into<Name>, TypeLike: Into<Type>>( name: NameLike, returns: TypeLike, ) -> Property
sourcepub fn visibility_modifier(
self,
visibility_modifier: VisibilityModifier,
) -> Property
pub fn visibility_modifier( self, visibility_modifier: VisibilityModifier, ) -> Property
Sets VisibilityModifier
sourcepub fn inheritance_modifier(
self,
inheritance_modifier: MemberInheritanceModifier,
) -> Property
pub fn inheritance_modifier( self, inheritance_modifier: MemberInheritanceModifier, ) -> Property
sourcepub fn initializer<CodeBlockLike: Into<CodeBlock>>(
self,
initializer: CodeBlockLike,
) -> Property
pub fn initializer<CodeBlockLike: Into<CodeBlock>>( self, initializer: CodeBlockLike, ) -> Property
Sets property initializer val some = <initializer>
Exclusive with Property::delegate
sourcepub fn delegate<CodeBlockLike: Into<CodeBlock>>(
self,
delegate: CodeBlockLike,
) -> Property
pub fn delegate<CodeBlockLike: Into<CodeBlock>>( self, delegate: CodeBlockLike, ) -> Property
Sets property delegate val some by <delegate>
Exclusive with Property::initializer
sourcepub fn getter(self, getter: PropertyGetter) -> Property
pub fn getter(self, getter: PropertyGetter) -> Property
Sets PropertyGetter
sourcepub fn setter(self, setter: PropertySetter) -> Property
pub fn setter(self, setter: PropertySetter) -> Property
Sets PropertySetter
sourcepub fn annotation(self, annotation: Annotation) -> Self
pub fn annotation(self, annotation: Annotation) -> Self
Adds Annotation to this entity. They will appear in order this method is called.
Trait Implementations§
source§impl RenderKotlin for Property
impl RenderKotlin for Property
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 Property
impl RefUnwindSafe for Property
impl Send for Property
impl Sync for Property
impl Unpin for Property
impl UnwindSafe for Property
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
)