[][src]Struct rebound::AssocFn

pub struct AssocFn { /* fields omitted */ }

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]

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]

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]

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

impl Debug for AssocFn[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.