Trait native_windows_gui::custom::ResourceT
[−]
[src]
pub trait ResourceT<ID: Clone + Hash> { fn type_id(&self) -> TypeId; fn build(&self, ui: &Ui<ID>) -> Result<Box<Resource>, Error>; }
Structures implementing this trait can be used by a Ui to build a Resource
Required Methods
fn type_id(&self) -> TypeId
Should return the TypeId of the generated resource. For example a FontT
struct returns the TypeId of a Font
struct.
fn build(&self, ui: &Ui<ID>) -> Result<Box<Resource>, Error>
Should instance the resource and return it as a Boxui.commit
.