Skip to main content

native_borrow_checks

Function native_borrow_checks 

Source
pub(crate) fn native_borrow_checks<'a>(
    args: impl IntoIterator<Item = (usize, String, &'a Type)>,
    argv: &Ident,
    targets: Option<&[Ident]>,
) -> TokenStream
Expand description

Check native arguments before conversion can create references. Arity must already be checked, and the caller must be inside the shim’s R unwind boundary. &Self uses ExternalPtr handles and its separate address check.

An argument that argument converts through plain TryFromSexp can be prepared, so an Either is checked against the arm its conversion takes (#1504): the check declares its prepared_binding, which argument converts from.