pub trait ExtractableExt: IsA<Extractable> + Sealed + 'static {
    // Provided methods
    fn asset(&self) -> Option<Asset> { ... }
    fn id(&self) -> GString { ... }
    fn set_asset(&self, asset: &impl IsA<Asset>) -> Result<(), BoolError> { ... }
}
Expand description

Provided Methods§

source

fn asset(&self) -> Option<Asset>

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.

source

fn id(&self) -> GString

Gets the 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 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 id.

§Returns

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

source

fn set_asset(&self, asset: &impl IsA<Asset>) -> Result<(), BoolError>

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 id.

§asset

The asset to set

§Returns

true if asset could be successfully set on self.

Object Safety§

This trait is not object safe.

Implementors§