Trait harfbuzz_rs::HarfbuzzObject[][src]

pub unsafe trait HarfbuzzObject: Sized {
    type Raw;
    unsafe fn reference(&self);
unsafe fn dereference(&self); unsafe fn from_raw<'a>(val: *const Self::Raw) -> &'a Self { ... }
unsafe fn from_raw_mut<'a>(val: *mut Self::Raw) -> &'a mut Self { ... }
fn as_raw(&self) -> *mut Self::Raw { ... } }

A trait which is implemented for all harffbuzz wrapper structs. It exposes common functionality for converting from and to the underlying raw harfbuzz pointers that are useful for ffi.

This trait may only be implemented for structs that are zero-sized and is therefore unsafe to implement.

Associated Types

Type of the raw harfbuzz object.

Required Methods

Increases the reference count of the HarfBuzz object.

Wraps a hb_TYPE_reference() call.

Decreases the reference count of the HarfBuzz object and destroys it if the reference count reaches zero.

Wraps a hb_TYPE_destroy() call.

Provided Methods

Important traits for &'a mut R

Creates a reference from a harfbuzz object pointer.

Unsafe because a raw pointer may be accessed. The reference count is not changed. Should not be called directly by a library user.

Use the Owned and Shared abstractions instead.

Important traits for &'a mut R

Creates a mutable reference from a harfbuzz object pointer.

Unsafe because a raw pointer may be accessed. The reference count is not changed. Should not be called directly by a library user.

Use the Owned and Shared abstractions instead.

Returns the underlying harfbuzz object pointer.

The caller must ensure, that this pointer is not used after self's destruction.

Implementors