Skip to content

Support enif_make_resource_binary #452

Closed
@cigrainger

Description

@cigrainger

This is in rustler_sys, but it would be nice to have it wrapped more safely in rustler.

I'd be happy to contribute this one but could use some guidance on the API. I was thinking it would make sense to add ResourceBinary to rustler::resource (though maybe it should live in rustler::types::binary?). ResourceBinary::new would take a ResourceArc and a reference to a binary with a lifetime tied to the resource object. It would hold the cloned ResourceArc and the reference to the binary as well as the size of the binary.

Does that sound reasonable? Other than lifetime annotations, are there any other considerations for ensuring the binary data is handled properly if it's external to the resource object?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions