Struct harfbuzz_rs::Shared [] [src]

pub struct Shared<T: HarfbuzzObject> { /* fields omitted */ }

A smart pointer that wraps an atomically reference counted HarfBuzz object.

Usually you don't create a Shared yourself, but get it from another function in this crate. You can just use the methods of the wrapped object through its Deref implementation.

A Shared is a safe wrapper for reference counted HarfBuzz objects and provides shared immutable access to its inner object. As HarfBuzz' objects are all thread-safe Shared implements Send and Sync.

Tries to mirror the stdlib Arc interface where applicable as HarfBuzz' reference counting has similar semantics.

Methods

impl<T: HarfbuzzObject> Shared<T>
[src]

[src]

Creates a Shared from a raw harfbuzz pointer.

Transfers ownership. Use of the original pointer is now forbidden! Unsafe because dereferencing a raw pointer is necessary.

[src]

Converts self into the underlying harfbuzz object pointer value. The resulting pointer has to be manually destroyed using hb_TYPE_destroy or be converted back into the wrapper using the from_raw function to avoid leaking memory.

[src]

Trait Implementations

impl<'a, T> From<T> for Shared<Blob<'a>> where
    T: 'static + Send + AsRef<[u8]>, 
[src]

[src]

Performs the conversion.

impl<T: Debug + HarfbuzzObject> Debug for Shared<T> where
    T::Raw: Debug
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: PartialEq + HarfbuzzObject> PartialEq for Shared<T> where
    T::Raw: PartialEq
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<T: Eq + HarfbuzzObject> Eq for Shared<T> where
    T::Raw: Eq
[src]

impl<T: HarfbuzzObject> Clone for Shared<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: HarfbuzzObject> Deref for Shared<T>
[src]

The resulting type after dereferencing.

Important traits for &'a mut W
[src]

Dereferences the value.

impl<T: HarfbuzzObject> Borrow<T> for Shared<T>
[src]

Important traits for &'a mut W
[src]

Immutably borrows from an owned value. Read more

impl<T: HarfbuzzObject> From<Owned<T>> for Shared<T>
[src]

[src]

Performs the conversion.

impl<T: HarfbuzzObject> Drop for Shared<T>
[src]

[src]

Executes the destructor for this type. Read more

impl<T: HarfbuzzObject + Sync + Send> Send for Shared<T>
[src]

impl<T: HarfbuzzObject + Sync + Send> Sync for Shared<T>
[src]