[][src]Struct cairo::UserDataKey

pub struct UserDataKey<T> { /* fields omitted */ }

A key for indexing user data in various cairo types.

Some types like [Surface] have get_user_data, set_user_data, and remove_user_data methods that take &'static UserDataKey, where the address of that reference is significant.

To reliably have a stable address, the expected usage is to define a static item:

use cairo::UserDataKey;
static FOO: UserDataKey<String> = UserDataKey::new();

surface.get_user_data(&FOO)

Implementations

impl<T> UserDataKey<T>[src]

pub const fn new() -> Self[src]

Trait Implementations

impl<T> Sync for UserDataKey<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for UserDataKey<T> where
    T: RefUnwindSafe

impl<T> !Send for UserDataKey<T>

impl<T> Unpin for UserDataKey<T>

impl<T> UnwindSafe for UserDataKey<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.