Struct rhai::ScriptFnMetadata
source · [−]#[non_exhaustive]pub struct ScriptFnMetadata<'a> {
pub name: &'a str,
pub params: Vec<&'a str>,
pub access: FnAccess,
pub comments: Vec<&'a str>,
}
Expand description
A type containing the metadata of a script-defined function.
Not available under no_function
.
Created by AST::iter_functions
.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.name: &'a str
Function name.
params: Vec<&'a str>
Function parameters (if any).
access: FnAccess
Function access mode.
comments: Vec<&'a str>
(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 slice with line-breaks within.
Line doc-comments are kept in one string slice per line without the termination line-break.
Leading white-spaces are stripped, and each string slice always starts with the
corresponding doc-comment leader: ///
or /**
.
Trait Implementations
sourceimpl<'a> Clone for ScriptFnMetadata<'a>
impl<'a> Clone for ScriptFnMetadata<'a>
sourcefn clone(&self) -> ScriptFnMetadata<'a>
fn clone(&self) -> ScriptFnMetadata<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for ScriptFnMetadata<'a>
impl<'a> Debug for ScriptFnMetadata<'a>
sourceimpl Display for ScriptFnMetadata<'_>
impl Display for ScriptFnMetadata<'_>
sourceimpl<'a> From<&'a ScriptFnDef> for ScriptFnMetadata<'a>
impl<'a> From<&'a ScriptFnDef> for ScriptFnMetadata<'a>
sourcefn from(value: &'a ScriptFnDef) -> Self
fn from(value: &'a ScriptFnDef) -> Self
Converts to this type from the input type.
sourceimpl<'a> Hash for ScriptFnMetadata<'a>
impl<'a> Hash for ScriptFnMetadata<'a>
sourceimpl<'a> Ord for ScriptFnMetadata<'a>
impl<'a> Ord for ScriptFnMetadata<'a>
sourcefn cmp(&self, other: &ScriptFnMetadata<'a>) -> Ordering
fn cmp(&self, other: &ScriptFnMetadata<'a>) -> Ordering
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl<'a> PartialEq<ScriptFnMetadata<'a>> for ScriptFnMetadata<'a>
impl<'a> PartialEq<ScriptFnMetadata<'a>> for ScriptFnMetadata<'a>
sourcefn eq(&self, other: &ScriptFnMetadata<'a>) -> bool
fn eq(&self, other: &ScriptFnMetadata<'a>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourceimpl<'a> PartialOrd<ScriptFnMetadata<'a>> for ScriptFnMetadata<'a>
impl<'a> PartialOrd<ScriptFnMetadata<'a>> for ScriptFnMetadata<'a>
sourcefn partial_cmp(&self, other: &ScriptFnMetadata<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &ScriptFnMetadata<'a>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a> Eq for ScriptFnMetadata<'a>
impl<'a> StructuralEq for ScriptFnMetadata<'a>
impl<'a> StructuralPartialEq for ScriptFnMetadata<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for ScriptFnMetadata<'a>
impl<'a> Send for ScriptFnMetadata<'a>
impl<'a> Sync for ScriptFnMetadata<'a>
impl<'a> Unpin for ScriptFnMetadata<'a>
impl<'a> UnwindSafe for ScriptFnMetadata<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more