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
Trait containing all Extractable
methods.
§Implementors
AudioSource
, AudioTestSource
, AudioTransition
, AudioUriSource
, BaseEffectClip
, BaseEffect
, BaseTransitionClip
, BaseXmlFormatter
, Clip
, CommandLineFormatter
, Container
, EffectClip
, Effect
, Extractable
, Formatter
, Group
, ImageSource
, Layer
, MultiFileSource
, OperationClip
, Operation
, OverlayClip
, SourceClip
, Source
, TestClip
, TextOverlayClip
, TextOverlay
, TimelineElement
, Timeline
, TitleClip
, TitleSource
, TrackElement
, TransitionClip
, Transition
, UriClip
, VideoSource
, VideoTestSource
, VideoTransition
, VideoUriSource
, XmlFormatter
Provided Methods§
sourcefn id(&self) -> GString
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.
sourcefn set_asset(&self, asset: &impl IsA<Asset>) -> Result<(), BoolError>
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
.