[−][src]Struct rebound::AssocFn
Info about an associated function on a Type
, either dynamic or static. Allows calling the
function, assuming reflection was configured to allow it.
Implementations
impl AssocFn
[src]
pub unsafe fn new_static(
call: fn'a(_: Vec<Value<'a>>) -> Value<'a>,
name: &'static str,
assoc_ty: Type,
args: &[Type],
ret: Type
) -> AssocFn
[src]
call: fn'a(_: Vec<Value<'a>>) -> Value<'a>,
name: &'static str,
assoc_ty: Type,
args: &[Type],
ret: Type
) -> AssocFn
Internal Function, creates a new static function reference
Safety
Should only be called within a ReflectedImpl
's assoc_fns
implementation
pub unsafe fn new_dynamic(
call: fn'a(_: Value<'a>, _: Vec<Value<'a>>) -> Value<'a>,
name: &'static str,
assoc_ty: Type,
self_ty: Type,
args: &[Type],
ret: Type
) -> AssocFn
[src]
call: fn'a(_: Value<'a>, _: Vec<Value<'a>>) -> Value<'a>,
name: &'static str,
assoc_ty: Type,
self_ty: Type,
args: &[Type],
ret: Type
) -> AssocFn
Internal Function, creates a new dynamic function reference
Safety
Should only be called within a ReflectedImpl
's assoc_fns
implementation
pub fn name(&self) -> &'static str
[src]
Get the name of this function in code
pub fn assoc_ty(&self) -> Type
[src]
Get the Type this function was defined on
pub fn arg_tys(&self) -> &Vec<Type>
[src]
Get the Types of the arguments to this function
pub fn ret_ty(&self) -> Type
[src]
Get the return Type of this function
pub fn kind(&self) -> &FnKind
[src]
Get the kind of this function, which contains specific information
pub fn call<'a>(
&self,
this: Option<Value<'a>>,
args: Vec<Value<'a>>
) -> Result<Value<'a>, Error>
[src]
&self,
this: Option<Value<'a>>,
args: Vec<Value<'a>>
) -> Result<Value<'a>, Error>
Attempt to call this function with the provided receiver and arguments.
The receiver should only be provided if this is a dynamic function, the number of arguments must exactly match the number required to call the function, and reflection must be configured to support calling this function.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for AssocFn
[src]
impl Send for AssocFn
[src]
impl Sync for AssocFn
[src]
impl Unpin for AssocFn
[src]
impl UnwindSafe for AssocFn
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,