pub struct NativeFunction { /* private fields */ }
Implementations§
Source§impl NativeFunction
impl NativeFunction
pub fn new<S, AS, D, B>(name: S, argspec: AS, doc: D, body: B) -> NativeFunction
pub fn name(&self) -> &RcStr
pub fn argspec(&self) -> &ArgSpec
pub fn doc(&self) -> &Option<RcStr>
pub fn apply( &self, globals: &mut Globals, args: Vec<Value>, kwargs: Option<HashMap<RcStr, Value>>, ) -> Result<Value, Error>
Trait Implementations§
Source§impl Debug for NativeFunction
impl Debug for NativeFunction
Source§impl From<NativeFunction> for Value
impl From<NativeFunction> for Value
Source§fn from(f: NativeFunction) -> Value
fn from(f: NativeFunction) -> Value
Converts to this type from the input type.
Source§impl PartialEq for NativeFunction
impl PartialEq for NativeFunction
Auto Trait Implementations§
impl Freeze for NativeFunction
impl !RefUnwindSafe for NativeFunction
impl !Send for NativeFunction
impl !Sync for NativeFunction
impl Unpin for NativeFunction
impl !UnwindSafe for NativeFunction
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
Source§impl<T> SetParameter for T
impl<T> SetParameter for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.