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.
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 /**
.
Function access mode.
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>
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
sourcefn ne(&self, other: &ScriptFnMetadata<'a>) -> bool
fn ne(&self, other: &ScriptFnMetadata<'a>) -> bool
This method tests for !=
.
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
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more