Struct rhai::ScriptFuncDef
source · pub struct ScriptFuncDef {
pub body: StmtBlock,
pub name: ImmutableString,
pub access: FnAccess,
pub this_type: Option<ImmutableString>,
pub params: FnArgsVec<ImmutableString>,
pub comments: StaticVec<SmartString<LazyCompact>>,
}
Expand description
(internals) A type containing information on a script-defined function.
Exported under the internals
feature only.
Fields§
§body: StmtBlock
Function body.
name: ImmutableString
Function name.
access: FnAccess
Function access mode.
this_type: Option<ImmutableString>
Type of this
pointer, if any.
Not available under no_object
.
params: FnArgsVec<ImmutableString>
Names of function parameters.
comments: StaticVec<SmartString<LazyCompact>>
(metadata) Function doc-comments (if any). Exported under the metadata
feature only.
Doc-comments are comment lines beginning with ///
or comment blocks beginning with /**
,
placed immediately before a function definition.
Block doc-comments are kept in a single string with line-breaks within.
Line doc-comments are merged, with line-breaks, into a single string without a termination line-break.
Leading white-spaces are stripped, and each string always starts with the corresponding
doc-comment leader: ///
or /**
.
Each line in non-block doc-comments starts with ///
.
Trait Implementations§
source§impl Clone for ScriptFuncDef
impl Clone for ScriptFuncDef
source§fn clone(&self) -> ScriptFuncDef
fn clone(&self) -> ScriptFuncDef
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ScriptFuncDef
impl Debug for ScriptFuncDef
source§impl Display for ScriptFuncDef
impl Display for ScriptFuncDef
source§impl<'a> From<&'a ScriptFuncDef> for ScriptFnMetadata<'a>
impl<'a> From<&'a ScriptFuncDef> for ScriptFnMetadata<'a>
source§fn from(value: &'a ScriptFuncDef) -> Self
fn from(value: &'a ScriptFuncDef) -> Self
source§impl From<ScriptFuncDef> for RhaiFunc
impl From<ScriptFuncDef> for RhaiFunc
source§fn from(fn_def: ScriptFuncDef) -> Self
fn from(fn_def: ScriptFuncDef) -> Self
Auto Trait Implementations§
impl Freeze for ScriptFuncDef
impl !RefUnwindSafe for ScriptFuncDef
impl !Send for ScriptFuncDef
impl !Sync for ScriptFuncDef
impl Unpin for ScriptFuncDef
impl !UnwindSafe for ScriptFuncDef
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
source§impl<T> Variant for T
impl<T> Variant for T
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Variant
trait object to &mut dyn Any
.source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Variant
trait object to Box<dyn Any>
.