Trait gdk_pixbuf::subclass::prelude::BoxedType

source ·
pub trait BoxedType: Sized + StaticType + Clone + 'static {
    const NAME: &'static str;
    const ALLOW_NAME_CONFLICT: bool = false;
}
Expand description

Trait for defining boxed types.

Links together the type name with the type itself.

See register_boxed_type for registering an implementation of this trait with the type system.

Required Associated Constants§

source

const NAME: &'static str

Boxed type name.

This must be unique in the whole process.

Provided Associated Constants§

source

const ALLOW_NAME_CONFLICT: bool = false

Allow name conflicts for this boxed type.

By default, trying to register a type with a name that was registered before will panic. If this is set to true then a new name will be selected by appending a counter.

This is useful for defining new types in Rust library crates that might be linked multiple times in the same process.

A consequence of setting this to true is that it’s not guaranteed that glib::Type::from_name(Self::NAME).unwrap() == Self::static_type().

Optional.

Object Safety§

This trait is not object safe.

Implementors§