Trait vizia::vg::wrapper::RefWrapper

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

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

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

This trait is implemented for all wrapper types that wrap C/C++ references.

§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_ref(native: &N) -> &Self

fn wrap_mut(native: &mut N) -> &mut Self

fn inner(&self) -> &N

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

Object Safety§

This trait is not object safe.

Implementors§

§

impl<N> RefWrapper<N> for Handle<N>
where N: NativeDrop,