Skip to main content

FarCall

Trait FarCall 

Source
pub trait FarCall<Args>
where Args: Tuple + BankSafe,
{ type Output: BankSafe; // Required method fn invoke<C>(&self, outer: &mut Bank<C>, args: Args) -> Self::Output where C: Group; }
Available on crate feature bank only.
Expand description

A far pointer that can be called across a bank boundary.

Implemented by Far and DynFar over function pointers, this is the unified call interface: invoke switches into the target bank, invokes the function with args, and restores the caller’s bank C. The #[bank] macro rewrites recv.invoke(args) onto it.

Required Associated Types§

Source

type Output: BankSafe

The function’s return type.

Required Methods§

Source

fn invoke<C>(&self, outer: &mut Bank<C>, args: Args) -> Self::Output
where C: Group,

Switch into the far function’s bank, call it with args, restore C.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F, Args> FarCall<Args> for DynFar<F>
where F: Copy + Fn<Args>, Args: Tuple + BankSafe, <F as FnOnce<Args>>::Output: BankSafe,

Source§

type Output = <F as FnOnce<Args>>::Output

Source§

impl<F, G, Args> FarCall<Args> for Far<F, G>
where F: Copy + Fn<Args>, G: Group, Args: Tuple + BankSafe, <F as FnOnce<Args>>::Output: BankSafe,

Source§

type Output = <F as FnOnce<Args>>::Output