[][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();



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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

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

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

The type returned in the event of a conversion error.