pub enum KtBody {
None,
Expr(KtCode),
Block(KtCode),
External,
}Expand description
A function body — or the reason there isn’t one.
Variants§
None
No body because the function is abstract. Whether that is legal is
positional — an interface member needs no keyword, an abstract
class member does — which no type here can capture, so this one stays
a validated case rather than a guaranteed one.
Expr(KtCode)
Single-expression body: = <expr>.
Block(KtCode)
Block body: { … }.
External
external fun f() — implemented natively, so no body by definition.
Being a body variant rather than a modifier keyword is what makes
external fun f() { … } unrepresentable.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KtBody
impl RefUnwindSafe for KtBody
impl Send for KtBody
impl Sync for KtBody
impl Unpin for KtBody
impl UnsafeUnpin for KtBody
impl UnwindSafe for KtBody
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