pub struct FfiCtx<'a> {
pub func_name: &'a str,
pub vm_objs: &'a VMObjects,
pub user_data: Option<usize>,
pub stack: &'a mut Stack,
pub gcc: &'a GcContainer,
/* private fields */
}
Fields§
§func_name: &'a str
§vm_objs: &'a VMObjects
§user_data: Option<usize>
§stack: &'a mut Stack
§gcc: &'a GcContainer
Implementations§
Source§impl<'a> FfiCtx<'a>
impl<'a> FfiCtx<'a>
pub fn new_nil(t: ValueType) -> GosValue
pub fn new_nil_slice(t_elem: ValueType) -> GosValue
pub fn new_uint_ptr(u: usize) -> GosValue
pub fn new_complex64(r: f32, i: f32) -> GosValue
pub fn new_function(f: FunctionKey) -> GosValue
pub fn new_package(p: PackageKey) -> GosValue
pub fn new_metadata(m: Meta) -> GosValue
pub fn new_complex128(r: f64, i: f64) -> GosValue
pub fn new_string(s: &str) -> GosValue
pub fn new_unsafe_ptr(p: Rc<dyn UnsafePtr>) -> GosValue
pub fn new_struct(&self, fields: Vec<GosValue>) -> GosValue
pub fn new_array(&self, member: Vec<GosValue>, t_elem: ValueType) -> GosValue
pub fn new_primitive_array<T>(
&self,
member: Vec<T>,
t_elem: ValueType,
) -> GosValuewhere
T: CellData,
pub fn new_map(&self, m: HashMap<GosValue, GosValue>) -> GosValue
pub fn new_pointer(pointee: GosValue) -> GosValue
Sourcepub fn new_interface(
&self,
underlying: GosValue,
metas: Option<(&Meta, Meta)>,
) -> GosValue
pub fn new_interface( &self, underlying: GosValue, metas: Option<(&Meta, Meta)>, ) -> GosValue
Create a new interface value with the underlying value, and optionally the meta of the interface and the value.
– Note –
if you pass None
to metas, the returned interface won’t behave like
a normal interface. you cannot cast it or call it’s methods.
§Arguments
underlying
- The underlying valuemetas
- (Interface meta, value meta)
pub fn new_empty_interface(&self, underlying: GosValue, meta: Meta) -> GosValue
pub fn deref_pointer(&self, ptr: &GosValue) -> Result<GosValue, RuntimeError>
pub fn zero_val(&self, m: &Meta) -> GosValue
pub fn slice_as_rust_slice<T>(
val: &GosValue,
) -> Result<Ref<'_, [T]>, RuntimeError>where
T: Element,
pub fn slice_as_primitive_slice<'b, C, D>( val: &'b GosValue, ) -> Result<Ref<'b, [D]>, RuntimeError>
pub fn array_as_rust_slice<T>(val: &GosValue) -> Ref<'_, [T]>where
T: Element,
pub fn array_as_primitive_slice<'b, C, D>(val: &'b GosValue) -> Ref<'b, [D]>
Auto Trait Implementations§
impl<'a> Freeze for FfiCtx<'a>
impl<'a> !RefUnwindSafe for FfiCtx<'a>
impl<'a> !Send for FfiCtx<'a>
impl<'a> !Sync for FfiCtx<'a>
impl<'a> Unpin for FfiCtx<'a>
impl<'a> !UnwindSafe for FfiCtx<'a>
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