Trait vizia_core::vg::wrapper::NativeTransmutableWrapper

pub unsafe trait NativeTransmutableWrapper<N> {
    // Required methods
    fn wrap(native: N) -> Self;
    fn unwrap(self) -> N;
    fn inner(&self) -> &N;
    fn inner_mut(&mut self) -> &mut N;
}
Expand description

A trait that supports the conversion from a C/C++ value into its Rust wrapper and back.

The wrapped value can be accessed through the functions inner and inner_mut.

This trait is implemented for for all types that implement NativeTransmutable<N>.

§Safety

The native type N should be treated as opaque, because its definition may change without adhering to semantic versioning and depends on what the tool bindgen is able to generate.

Converting from a Rust wrapper to a wrapped value may lose the automatic ability to free associated memory.

Required Methods§

fn wrap(native: N) -> Self

fn unwrap(self) -> N

fn inner(&self) -> &N

fn inner_mut(&mut self) -> &mut N

Object Safety§

This trait is not object safe.

Implementors§

§

impl<N, T> NativeTransmutableWrapper<N> for T
where T: NativeTransmutable<N>,