pub trait MapGenerator {
// Required method
fn create_map<C: Into<Rgb<u8>> + Clone, F: Fn(&str) -> C, I: IntoIterator<Item = Rc<str>>>(
&self,
assoc: F,
key_list: Option<I>,
) -> RgbImage;
// Provided method
fn create_map_flat<C: Into<Rgb<u8>> + Clone, I: IntoIterator<Item = Rc<str>>>(
&self,
key_list: I,
target_color: C,
) -> RgbImage { ... }
}
Required Methods§
Sourcefn create_map<C: Into<Rgb<u8>> + Clone, F: Fn(&str) -> C, I: IntoIterator<Item = Rc<str>>>(
&self,
assoc: F,
key_list: Option<I>,
) -> RgbImage
fn create_map<C: Into<Rgb<u8>> + Clone, F: Fn(&str) -> C, I: IntoIterator<Item = Rc<str>>>( &self, assoc: F, key_list: Option<I>, ) -> RgbImage
Creates a new instance of map, with pixels colored in accordance with assoc function. key_list acts as a whitelist of keys to use assoc on. If it’s None then assoc is applied to all keys.
Provided Methods§
Sourcefn create_map_flat<C: Into<Rgb<u8>> + Clone, I: IntoIterator<Item = Rc<str>>>(
&self,
key_list: I,
target_color: C,
) -> RgbImage
fn create_map_flat<C: Into<Rgb<u8>> + Clone, I: IntoIterator<Item = Rc<str>>>( &self, key_list: I, target_color: C, ) -> RgbImage
Creates a new instance of map, with all pixels corresponding to keys in the key_list colored same as the target_color
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.