Trait Asset Ext
Source pub trait AssetExt: IsA<Asset> + 'static {
Show 15 methods
// Provided methods
fn extract(&self) -> Result<Extractable, Error> { ... }
fn error(&self) -> Option<Error> { ... }
fn error_full(&self) -> Option<Error> { ... }
fn extractable_type(&self) -> Type { ... }
fn id(&self) -> GString { ... }
fn proxy(&self) -> Option<Asset> { ... }
fn proxy_full(&self) -> Option<Asset> { ... }
fn proxy_target(&self) -> Option<Asset> { ... }
fn proxy_target_full(&self) -> Option<Asset> { ... }
fn list_proxies(&self) -> Vec<Asset> { ... }
fn list_proxies_full(&self) -> Vec<Asset> { ... }
fn set_proxy(
&self,
proxy: Option<&impl IsA<Asset>>,
) -> Result<(), BoolError> { ... }
fn unproxy(&self, proxy: &impl IsA<Asset>) -> Result<(), BoolError> { ... }
fn connect_proxy_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_proxy_target_notify<F: Fn(&Self) + Send + Sync + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}Expand description
Provided Methods§
Sourcefn extract(&self) -> Result<Extractable, Error>
fn extract(&self) -> Result<Extractable, Error>
Extracts a new extractable-type object from the asset. The
id of the asset may determine the properties and state of the
newly created object.
§Returns
A newly created object, or None if an
error occurred.
Sourcefn error(&self) -> Option<Error>
👎Deprecated: Since 1.30
fn error(&self) -> Option<Error>
Since 1.30
Retrieve the error that was set on the asset when it was loaded.
§Deprecated since 1.30
Use error_full() instead for MT-safety.
§Returns
The error set on asset, or
None if no error occurred when asset was loaded.
Sourcefn error_full(&self) -> Option<Error>
fn error_full(&self) -> Option<Error>
Sourcefn extractable_type(&self) -> Type
fn extractable_type(&self) -> Type
Sourcefn proxy(&self) -> Option<Asset>
👎Deprecated: Since 1.30
fn proxy(&self) -> Option<Asset>
Since 1.30
Gets the default proxy of the asset.
§Deprecated since 1.30
Use proxy_full() instead for MT-safety.
§Returns
The default proxy of self.
Sourcefn proxy_full(&self) -> Option<Asset>
fn proxy_full(&self) -> Option<Asset>
Sourcefn proxy_target(&self) -> Option<Asset>
👎Deprecated: Since 1.30
fn proxy_target(&self) -> Option<Asset>
Since 1.30
Gets the proxy-target of the asset.
Note that the proxy target may have loaded with an error, so you should
call error() on the returned target.
§Deprecated since 1.30
Use proxy_target_full() instead for MT-safety.
§Returns
The asset that self is a proxy
of.
Sourcefn proxy_target_full(&self) -> Option<Asset>
fn proxy_target_full(&self) -> Option<Asset>
Gets the proxy-target of the asset.
Note that the proxy target may have loaded with an error, so you should
call error() on the returned target.
§Returns
The asset that self is a proxy
of, or None if self is not a proxy for another asset.
Sourcefn list_proxies(&self) -> Vec<Asset>
👎Deprecated: Since 1.30
fn list_proxies(&self) -> Vec<Asset>
Since 1.30
Get all the proxies that the asset has. The first item of the list will
be the default proxy. The second will be the proxy that is
‘next in line’ to be default, and so on.
§Deprecated since 1.30
Use list_proxies_full() instead for MT-safety.
§Returns
The list of proxies
that self has.
Sourcefn list_proxies_full(&self) -> Vec<Asset>
fn list_proxies_full(&self) -> Vec<Asset>
Sourcefn set_proxy(&self, proxy: Option<&impl IsA<Asset>>) -> Result<(), BoolError>
fn set_proxy(&self, proxy: Option<&impl IsA<Asset>>) -> Result<(), BoolError>
Sets the proxy for the asset.
If proxy is among the existing proxies of the asset (see
list_proxies()) it will be moved to become the default
proxy. Otherwise, if proxy is not None, it will be added to the list
of proxies, as the new default. The previous default proxy will become
‘next in line’ for if the new one is removed, and so on. As such, this
will not actually remove the previous default proxy (use
unproxy() for that).
Note that an asset can only act as a proxy for one other asset.
As a special case, if proxy is None, then this method will actually
remove all proxies from the asset.
§proxy
A new default proxy for self
§Returns
true if proxy was successfully set as the default for
self.
Sourcefn unproxy(&self, proxy: &impl IsA<Asset>) -> Result<(), BoolError>
fn unproxy(&self, proxy: &impl IsA<Asset>) -> Result<(), BoolError>
Removes the proxy from the available list of proxies for the asset. If
the given proxy is the default proxy of the list, then the next proxy
in the available list (see list_proxies()) will become the
default. If there are no other proxies, then the asset will no longer
have a default proxy.
§proxy
An existing proxy of self
§Returns
true if proxy was successfully removed from self’s proxy
list.
fn connect_proxy_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_proxy_target_notify<F: Fn(&Self) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.