Struct rhai::ScriptFnDef
source · pub struct ScriptFnDef {
pub body: StmtBlock,
pub name: ImmutableString,
pub access: FnAccess,
pub this_type: Option<ImmutableString>,
pub params: SmallVec<[ImmutableString; 5]>,
pub comments: Box<[SmartString<LazyCompact>]>,
}Expand description
(internals) A type containing information on a script-defined function.
Exported under the internals feature only.
Fields§
§body: StmtBlockFunction body.
name: ImmutableStringFunction name.
access: FnAccessFunction access mode.
this_type: Option<ImmutableString>Type of this pointer, if any.
Not available under no_object.
params: SmallVec<[ImmutableString; 5]>Names of function parameters.
comments: Box<[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 ScriptFnDef
impl Clone for ScriptFnDef
source§fn clone(&self) -> ScriptFnDef
fn clone(&self) -> ScriptFnDef
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ScriptFnDef
impl Debug for ScriptFnDef
source§impl Display for ScriptFnDef
impl Display for ScriptFnDef
source§impl<'a> From<&'a ScriptFnDef> for ScriptFnMetadata<'a>
impl<'a> From<&'a ScriptFnDef> for ScriptFnMetadata<'a>
source§fn from(value: &'a ScriptFnDef) -> Self
fn from(value: &'a ScriptFnDef) -> Self
source§impl From<ScriptFnDef> for CallableFunction
impl From<ScriptFnDef> for CallableFunction
source§fn from(fn_def: ScriptFnDef) -> Self
fn from(fn_def: ScriptFnDef) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for ScriptFnDef
impl !Send for ScriptFnDef
impl !Sync for ScriptFnDef
impl Unpin for ScriptFnDef
impl !UnwindSafe for ScriptFnDef
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 Twhere
T: Any + Clone + SendSync,
impl<T> Variant for Twhere T: Any + Clone + SendSync,
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>.