pub trait DynamicSourceHandler:
Send
+ Sync
+ 'static {
// Required method
fn supply(&self, source: &Source) -> Box<dyn DynamicOrigin>;
// Provided methods
fn attribution(&self, _source: &Source) -> Option<String> { ... }
fn summary(&self, _source: &Source) -> SourceSummary { ... }
fn load(&self, _source: &Source) -> Load<ErasedDescription> { ... }
fn describes_in_background(&self) -> bool { ... }
fn describes_in_world(&self) -> bool { ... }
fn describe(
&self,
_source: &Source,
_world: &WorldMapping,
_data: Option<Data>,
respond: Respond<Described<ErasedDescription>>,
) { ... }
fn describe_image(
&self,
_source: &Source,
_image: PremultipliedImage,
) -> Described<ErasedDescription> { ... }
fn metadata_changed(&self, _previous: &Source, _source: &Source) -> bool { ... }
}Expand description
Type-level hooks for a DynamicSourceType.
Required Methods§
fn supply(&self, source: &Source) -> Box<dyn DynamicOrigin>
Provided Methods§
fn attribution(&self, _source: &Source) -> Option<String>
fn summary(&self, _source: &Source) -> SourceSummary
fn load(&self, _source: &Source) -> Load<ErasedDescription>
fn describes_in_background(&self) -> bool
fn describes_in_world(&self) -> bool
fn describe( &self, _source: &Source, _world: &WorldMapping, _data: Option<Data>, respond: Respond<Described<ErasedDescription>>, )
fn describe_image( &self, _source: &Source, _image: PremultipliedImage, ) -> Described<ErasedDescription>
fn metadata_changed(&self, _previous: &Source, _source: &Source) -> bool
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".