You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: func_state.rs
    path of file: ./repos/gdnative/gdnative-async/src/rt
    
    the code of the file until where you have to start completion: use gdnative_bindings::Reference;
use gdnative_core::core_types::{ToVariant, Variant};
use gdnative_core::export::user_data::{LocalCellData, Map, MapMut};
use gdnative_core::export::{
    ClassBuilder, NativeClass, NativeClassMethods, StaticArgs, StaticArgsMethod,
};
use gdnative_core::godot_site;
use gdnative_core::object::ownership::Unique;
use gdnative_core::object::{Instance, TInstance};
use gdnative_derive::FromVarar
    
    fn call(&self, this: TInstance<'_, FuncState>, args: Self::Args) -> Variant {
        this.map_mut(
            |s, owner| match std::mem::replace(&mut s.kind, Kind::Pending) {
                Kind::Resumable(resume) => {
                    resume.resume(args.arg);
                    owner.to_variant()
                }
                Kind::Pending => owner.to_variant(),
                Kind::Resolved(result) => {
                    s.kind = Kind::Resolved(result.clone());
                    result
                }
            },
        )
        .expect("no reentrancy")
    }