pub trait ExtractableExt: 'static {
    fn asset(&self) -> Option<Asset>;
    fn id(&self) -> GString;
    fn set_asset(&self, asset: &impl IsA<Asset>) -> Result<(), BoolError>;
}
Expand description

Required Methods

Get the asset that has been set on the extractable object.

Returns

The asset set on self, or None if no asset has been set.

Gets the property::Asset::id of some associated asset. It may be the case that the object has no set asset, or even that such an asset does not yet exist in the GES cache. Instead, this will return the asset property::Asset::id that is compatible with the current state of the object, as determined by the Extractable implementer. If it was indeed extracted from an asset, this should return the same as its corresponding asset property::Asset::id.

Returns

The property::Asset::id of some associated Asset that is compatible with self’s current state.

Sets the asset for this extractable object.

When an object is extracted from an asset using AssetExt::extract() its asset will be automatically set. Note that many classes that implement Extractable will automatically create their objects using assets when you call their new methods. However, you can use this method to associate an object with a compatible asset if it was created by other means and does not yet have an asset. Or, for some implementations of Extractable, you can use this to change the asset of the given extractable object, which will lead to a change in its state to match the new asset property::Asset::id.

asset

The asset to set

Returns

true if asset could be successfully set on self.

Implementors