pub struct SiImage { /* private fields */ }Expand description
Represents an image with text rendering capabilities.
Implementations§
Source§impl SiImage
impl SiImage
Sourcepub async fn from_network_async(image_url: &str) -> SiImage
pub async fn from_network_async(image_url: &str) -> SiImage
Creates a new SiImage from image data fetched from a network URL asynchronously.
§Arguments
image_url- The URL from which to fetch the image data.
Sourcepub fn from_network(image_url: &str) -> SiImage
pub fn from_network(image_url: &str) -> SiImage
Creates a new SiImage from image data fetched from a network URL synchronously.
§Arguments
image_url- The URL from which to fetch the image data.
Examples found in repository?
examples/image.rs (line 7)
5fn main() {
6 // Create the image
7 let mut img = SiImage::from_network("https://res.cloudinary.com/zype/image/upload/regraphic");
8 // Create the font
9 let font = SiFont::from_network(
10 "https://github.com/Zype-Z/ShareImage.js/raw/main/assets/fonts/sirin-stencil.ttf",
11 );
12 // Render some text
13 let text_options = TextOptions::default();
14 // img.render_text("Hello, World!", 64.0, 480.0, 254.0, None, &font, &text_options);
15 // Render something else
16 // img.render_text("Hello, World!", 48.0, 480.0, 320.0, None, &font, &text_options);
17 // Or do chained
18 img = img
19 .clone()
20 .render_text(
21 "Hello, World!",
22 64.0,
23 480.0,
24 254.0,
25 None,
26 &font,
27 &text_options,
28 )
29 .render_text(
30 "Hello, Another!",
31 48.0,
32 480.0,
33 320.0,
34 None,
35 &font,
36 &text_options,
37 );
38 // Write it
39 let mut file = fs::OpenOptions::new()
40 .create(true) // To create a new file
41 .write(true) // To write
42 .open("out.png")
43 .unwrap();
44 file.write_all(&img.to_bytes()).unwrap();
45}More examples
examples/macros.rs (line 21)
7fn main() {
8 // Create it with macro
9 preset! {
10 my_preset(img, font: SiFont, title: String, tagline: String) {
11 println!("{}", title);
12 let mut new = img;
13 render!(new: title; 480.0, 254.0; "font" &font, "scale" 64.0, "opts" &TextOptions::default(), "color" None);
14 render!(new: tagline; 480.0, 320.0; "font" &font, "scale" 48.0, "opts" &TextOptions::default(), "color" Some(String::from("#FFFFFF")));
15 new
16 }
17 };
18
19 // Use it
20 // Create the image
21 let mut img = SiImage::from_network("https://res.cloudinary.com/zype/image/upload/regraphic");
22 // Create the font
23 let font = SiFont::from_network(
24 "https://github.com/Zype-Z/ShareImage.js/raw/main/assets/fonts/sirin-stencil.ttf",
25 );
26 img.load_preset(
27 my_preset,
28 anymap! {
29 font: font,
30 title: "Hello, World!".to_string(),
31 tagline: "Cool!".to_string()
32 },
33 );
34 let mut file = fs::OpenOptions::new()
35 .create(true) // To create a new file
36 .write(true)
37 // either use the ? operator or unwrap since it returns a Result
38 .open("out.png")
39 .unwrap();
40 file.write_all(&img.to_bytes()).unwrap();
41}examples/preset.rs (line 54)
5fn main() {
6 // Create the preset
7 let preset = SiPreset::new(Box::new(|img, vals| {
8 let new_img = img.clone();
9 // img is the full image
10 println!("Dimensions: {}x{}", img.width(), img.height());
11 println!("Values: {:?}", vals);
12 // Get the font
13 let font = match vals.get("font") {
14 Some(font) => {
15 // Do type checking
16 if font.type_id() == std::any::TypeId::of::<SiFont>() {
17 // Downcast it
18 font.downcast_ref::<SiFont>().unwrap()
19 } else {
20 panic!(
21 "Expected type: {:?}\nFound type: {:?}",
22 std::any::TypeId::of::<SiFont>(),
23 font.type_id()
24 );
25 }
26 }
27 None => panic!("No font provided"),
28 };
29 // Render something on the image with that font
30 // Get the title
31 let title = match vals.get("title") {
32 Some(title) => {
33 // Do type checking
34 if title.type_id() == std::any::TypeId::of::<String>() {
35 // Downcast it
36 title.downcast_ref::<String>().unwrap()
37 } else {
38 panic!(
39 "Expected type: {:?}\nFound type: {:?}",
40 std::any::TypeId::of::<String>(),
41 title.type_id()
42 );
43 }
44 }
45 None => panic!("No title provided"),
46 };
47 let text_options = TextOptions::default();
48 // Render it
49 new_img.render_text(title, 64.0, 480.0, 254.0, None, font, &text_options)
50 }));
51
52 // Use it
53 // Create the image
54 let mut img = SiImage::from_network("https://res.cloudinary.com/zype/image/upload/regraphic");
55 // Create the font
56 let font = SiFont::from_network(
57 "https://github.com/Zype-Z/ShareImage.js/raw/main/assets/fonts/sirin-stencil.ttf",
58 );
59 let font_val: Box<dyn std::any::Any> = Box::new(font);
60 let title_val: Box<dyn std::any::Any> = Box::new("Hello, World!".to_string());
61 let values: HashMap<String, Box<dyn std::any::Any>> = HashMap::from([
62 ("font".to_string(), font_val),
63 ("title".to_string(), title_val),
64 ]);
65 img.load_preset(preset, values);
66 let mut file = fs::OpenOptions::new()
67 .create(true) // To create a new file
68 .write(true)
69 // either use the ? operator or unwrap since it returns a Result
70 .open("out.png")
71 .unwrap();
72 file.write_all(&img.to_bytes()).unwrap();
73}Sourcepub fn render_text(
self,
text: &str,
text_scale: f32,
pos_x: f32,
pos_y: f32,
color: Option<String>,
using_font: &SiFont,
options: &TextOptions,
) -> SiImage
pub fn render_text( self, text: &str, text_scale: f32, pos_x: f32, pos_y: f32, color: Option<String>, using_font: &SiFont, options: &TextOptions, ) -> SiImage
Renders text onto the image.
§Arguments
text- The text to render on the image.text_scale- The scale of the rendered text.pos_x- The X-coordinate position for rendering.pos_y- The Y-coordinate position for rendering.color- The color of the rendered text in hexadecimal format (e.g., “#RRGGBB”).using_font- The SiFont used for text rendering on the image.
§Returns
A mutable instance of the main image, with the text rendered on it.
Examples found in repository?
examples/image.rs (lines 20-28)
5fn main() {
6 // Create the image
7 let mut img = SiImage::from_network("https://res.cloudinary.com/zype/image/upload/regraphic");
8 // Create the font
9 let font = SiFont::from_network(
10 "https://github.com/Zype-Z/ShareImage.js/raw/main/assets/fonts/sirin-stencil.ttf",
11 );
12 // Render some text
13 let text_options = TextOptions::default();
14 // img.render_text("Hello, World!", 64.0, 480.0, 254.0, None, &font, &text_options);
15 // Render something else
16 // img.render_text("Hello, World!", 48.0, 480.0, 320.0, None, &font, &text_options);
17 // Or do chained
18 img = img
19 .clone()
20 .render_text(
21 "Hello, World!",
22 64.0,
23 480.0,
24 254.0,
25 None,
26 &font,
27 &text_options,
28 )
29 .render_text(
30 "Hello, Another!",
31 48.0,
32 480.0,
33 320.0,
34 None,
35 &font,
36 &text_options,
37 );
38 // Write it
39 let mut file = fs::OpenOptions::new()
40 .create(true) // To create a new file
41 .write(true) // To write
42 .open("out.png")
43 .unwrap();
44 file.write_all(&img.to_bytes()).unwrap();
45}More examples
examples/preset.rs (line 49)
5fn main() {
6 // Create the preset
7 let preset = SiPreset::new(Box::new(|img, vals| {
8 let new_img = img.clone();
9 // img is the full image
10 println!("Dimensions: {}x{}", img.width(), img.height());
11 println!("Values: {:?}", vals);
12 // Get the font
13 let font = match vals.get("font") {
14 Some(font) => {
15 // Do type checking
16 if font.type_id() == std::any::TypeId::of::<SiFont>() {
17 // Downcast it
18 font.downcast_ref::<SiFont>().unwrap()
19 } else {
20 panic!(
21 "Expected type: {:?}\nFound type: {:?}",
22 std::any::TypeId::of::<SiFont>(),
23 font.type_id()
24 );
25 }
26 }
27 None => panic!("No font provided"),
28 };
29 // Render something on the image with that font
30 // Get the title
31 let title = match vals.get("title") {
32 Some(title) => {
33 // Do type checking
34 if title.type_id() == std::any::TypeId::of::<String>() {
35 // Downcast it
36 title.downcast_ref::<String>().unwrap()
37 } else {
38 panic!(
39 "Expected type: {:?}\nFound type: {:?}",
40 std::any::TypeId::of::<String>(),
41 title.type_id()
42 );
43 }
44 }
45 None => panic!("No title provided"),
46 };
47 let text_options = TextOptions::default();
48 // Render it
49 new_img.render_text(title, 64.0, 480.0, 254.0, None, font, &text_options)
50 }));
51
52 // Use it
53 // Create the image
54 let mut img = SiImage::from_network("https://res.cloudinary.com/zype/image/upload/regraphic");
55 // Create the font
56 let font = SiFont::from_network(
57 "https://github.com/Zype-Z/ShareImage.js/raw/main/assets/fonts/sirin-stencil.ttf",
58 );
59 let font_val: Box<dyn std::any::Any> = Box::new(font);
60 let title_val: Box<dyn std::any::Any> = Box::new("Hello, World!".to_string());
61 let values: HashMap<String, Box<dyn std::any::Any>> = HashMap::from([
62 ("font".to_string(), font_val),
63 ("title".to_string(), title_val),
64 ]);
65 img.load_preset(preset, values);
66 let mut file = fs::OpenOptions::new()
67 .create(true) // To create a new file
68 .write(true)
69 // either use the ? operator or unwrap since it returns a Result
70 .open("out.png")
71 .unwrap();
72 file.write_all(&img.to_bytes()).unwrap();
73}Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Examples found in repository?
examples/image.rs (line 44)
5fn main() {
6 // Create the image
7 let mut img = SiImage::from_network("https://res.cloudinary.com/zype/image/upload/regraphic");
8 // Create the font
9 let font = SiFont::from_network(
10 "https://github.com/Zype-Z/ShareImage.js/raw/main/assets/fonts/sirin-stencil.ttf",
11 );
12 // Render some text
13 let text_options = TextOptions::default();
14 // img.render_text("Hello, World!", 64.0, 480.0, 254.0, None, &font, &text_options);
15 // Render something else
16 // img.render_text("Hello, World!", 48.0, 480.0, 320.0, None, &font, &text_options);
17 // Or do chained
18 img = img
19 .clone()
20 .render_text(
21 "Hello, World!",
22 64.0,
23 480.0,
24 254.0,
25 None,
26 &font,
27 &text_options,
28 )
29 .render_text(
30 "Hello, Another!",
31 48.0,
32 480.0,
33 320.0,
34 None,
35 &font,
36 &text_options,
37 );
38 // Write it
39 let mut file = fs::OpenOptions::new()
40 .create(true) // To create a new file
41 .write(true) // To write
42 .open("out.png")
43 .unwrap();
44 file.write_all(&img.to_bytes()).unwrap();
45}More examples
examples/macros.rs (line 40)
7fn main() {
8 // Create it with macro
9 preset! {
10 my_preset(img, font: SiFont, title: String, tagline: String) {
11 println!("{}", title);
12 let mut new = img;
13 render!(new: title; 480.0, 254.0; "font" &font, "scale" 64.0, "opts" &TextOptions::default(), "color" None);
14 render!(new: tagline; 480.0, 320.0; "font" &font, "scale" 48.0, "opts" &TextOptions::default(), "color" Some(String::from("#FFFFFF")));
15 new
16 }
17 };
18
19 // Use it
20 // Create the image
21 let mut img = SiImage::from_network("https://res.cloudinary.com/zype/image/upload/regraphic");
22 // Create the font
23 let font = SiFont::from_network(
24 "https://github.com/Zype-Z/ShareImage.js/raw/main/assets/fonts/sirin-stencil.ttf",
25 );
26 img.load_preset(
27 my_preset,
28 anymap! {
29 font: font,
30 title: "Hello, World!".to_string(),
31 tagline: "Cool!".to_string()
32 },
33 );
34 let mut file = fs::OpenOptions::new()
35 .create(true) // To create a new file
36 .write(true)
37 // either use the ? operator or unwrap since it returns a Result
38 .open("out.png")
39 .unwrap();
40 file.write_all(&img.to_bytes()).unwrap();
41}examples/preset.rs (line 72)
5fn main() {
6 // Create the preset
7 let preset = SiPreset::new(Box::new(|img, vals| {
8 let new_img = img.clone();
9 // img is the full image
10 println!("Dimensions: {}x{}", img.width(), img.height());
11 println!("Values: {:?}", vals);
12 // Get the font
13 let font = match vals.get("font") {
14 Some(font) => {
15 // Do type checking
16 if font.type_id() == std::any::TypeId::of::<SiFont>() {
17 // Downcast it
18 font.downcast_ref::<SiFont>().unwrap()
19 } else {
20 panic!(
21 "Expected type: {:?}\nFound type: {:?}",
22 std::any::TypeId::of::<SiFont>(),
23 font.type_id()
24 );
25 }
26 }
27 None => panic!("No font provided"),
28 };
29 // Render something on the image with that font
30 // Get the title
31 let title = match vals.get("title") {
32 Some(title) => {
33 // Do type checking
34 if title.type_id() == std::any::TypeId::of::<String>() {
35 // Downcast it
36 title.downcast_ref::<String>().unwrap()
37 } else {
38 panic!(
39 "Expected type: {:?}\nFound type: {:?}",
40 std::any::TypeId::of::<String>(),
41 title.type_id()
42 );
43 }
44 }
45 None => panic!("No title provided"),
46 };
47 let text_options = TextOptions::default();
48 // Render it
49 new_img.render_text(title, 64.0, 480.0, 254.0, None, font, &text_options)
50 }));
51
52 // Use it
53 // Create the image
54 let mut img = SiImage::from_network("https://res.cloudinary.com/zype/image/upload/regraphic");
55 // Create the font
56 let font = SiFont::from_network(
57 "https://github.com/Zype-Z/ShareImage.js/raw/main/assets/fonts/sirin-stencil.ttf",
58 );
59 let font_val: Box<dyn std::any::Any> = Box::new(font);
60 let title_val: Box<dyn std::any::Any> = Box::new("Hello, World!".to_string());
61 let values: HashMap<String, Box<dyn std::any::Any>> = HashMap::from([
62 ("font".to_string(), font_val),
63 ("title".to_string(), title_val),
64 ]);
65 img.load_preset(preset, values);
66 let mut file = fs::OpenOptions::new()
67 .create(true) // To create a new file
68 .write(true)
69 // either use the ? operator or unwrap since it returns a Result
70 .open("out.png")
71 .unwrap();
72 file.write_all(&img.to_bytes()).unwrap();
73}Sourcepub fn height(&self) -> u32
pub fn height(&self) -> u32
Examples found in repository?
examples/preset.rs (line 10)
5fn main() {
6 // Create the preset
7 let preset = SiPreset::new(Box::new(|img, vals| {
8 let new_img = img.clone();
9 // img is the full image
10 println!("Dimensions: {}x{}", img.width(), img.height());
11 println!("Values: {:?}", vals);
12 // Get the font
13 let font = match vals.get("font") {
14 Some(font) => {
15 // Do type checking
16 if font.type_id() == std::any::TypeId::of::<SiFont>() {
17 // Downcast it
18 font.downcast_ref::<SiFont>().unwrap()
19 } else {
20 panic!(
21 "Expected type: {:?}\nFound type: {:?}",
22 std::any::TypeId::of::<SiFont>(),
23 font.type_id()
24 );
25 }
26 }
27 None => panic!("No font provided"),
28 };
29 // Render something on the image with that font
30 // Get the title
31 let title = match vals.get("title") {
32 Some(title) => {
33 // Do type checking
34 if title.type_id() == std::any::TypeId::of::<String>() {
35 // Downcast it
36 title.downcast_ref::<String>().unwrap()
37 } else {
38 panic!(
39 "Expected type: {:?}\nFound type: {:?}",
40 std::any::TypeId::of::<String>(),
41 title.type_id()
42 );
43 }
44 }
45 None => panic!("No title provided"),
46 };
47 let text_options = TextOptions::default();
48 // Render it
49 new_img.render_text(title, 64.0, 480.0, 254.0, None, font, &text_options)
50 }));
51
52 // Use it
53 // Create the image
54 let mut img = SiImage::from_network("https://res.cloudinary.com/zype/image/upload/regraphic");
55 // Create the font
56 let font = SiFont::from_network(
57 "https://github.com/Zype-Z/ShareImage.js/raw/main/assets/fonts/sirin-stencil.ttf",
58 );
59 let font_val: Box<dyn std::any::Any> = Box::new(font);
60 let title_val: Box<dyn std::any::Any> = Box::new("Hello, World!".to_string());
61 let values: HashMap<String, Box<dyn std::any::Any>> = HashMap::from([
62 ("font".to_string(), font_val),
63 ("title".to_string(), title_val),
64 ]);
65 img.load_preset(preset, values);
66 let mut file = fs::OpenOptions::new()
67 .create(true) // To create a new file
68 .write(true)
69 // either use the ? operator or unwrap since it returns a Result
70 .open("out.png")
71 .unwrap();
72 file.write_all(&img.to_bytes()).unwrap();
73}Sourcepub fn width(&self) -> u32
pub fn width(&self) -> u32
Examples found in repository?
examples/preset.rs (line 10)
5fn main() {
6 // Create the preset
7 let preset = SiPreset::new(Box::new(|img, vals| {
8 let new_img = img.clone();
9 // img is the full image
10 println!("Dimensions: {}x{}", img.width(), img.height());
11 println!("Values: {:?}", vals);
12 // Get the font
13 let font = match vals.get("font") {
14 Some(font) => {
15 // Do type checking
16 if font.type_id() == std::any::TypeId::of::<SiFont>() {
17 // Downcast it
18 font.downcast_ref::<SiFont>().unwrap()
19 } else {
20 panic!(
21 "Expected type: {:?}\nFound type: {:?}",
22 std::any::TypeId::of::<SiFont>(),
23 font.type_id()
24 );
25 }
26 }
27 None => panic!("No font provided"),
28 };
29 // Render something on the image with that font
30 // Get the title
31 let title = match vals.get("title") {
32 Some(title) => {
33 // Do type checking
34 if title.type_id() == std::any::TypeId::of::<String>() {
35 // Downcast it
36 title.downcast_ref::<String>().unwrap()
37 } else {
38 panic!(
39 "Expected type: {:?}\nFound type: {:?}",
40 std::any::TypeId::of::<String>(),
41 title.type_id()
42 );
43 }
44 }
45 None => panic!("No title provided"),
46 };
47 let text_options = TextOptions::default();
48 // Render it
49 new_img.render_text(title, 64.0, 480.0, 254.0, None, font, &text_options)
50 }));
51
52 // Use it
53 // Create the image
54 let mut img = SiImage::from_network("https://res.cloudinary.com/zype/image/upload/regraphic");
55 // Create the font
56 let font = SiFont::from_network(
57 "https://github.com/Zype-Z/ShareImage.js/raw/main/assets/fonts/sirin-stencil.ttf",
58 );
59 let font_val: Box<dyn std::any::Any> = Box::new(font);
60 let title_val: Box<dyn std::any::Any> = Box::new("Hello, World!".to_string());
61 let values: HashMap<String, Box<dyn std::any::Any>> = HashMap::from([
62 ("font".to_string(), font_val),
63 ("title".to_string(), title_val),
64 ]);
65 img.load_preset(preset, values);
66 let mut file = fs::OpenOptions::new()
67 .create(true) // To create a new file
68 .write(true)
69 // either use the ? operator or unwrap since it returns a Result
70 .open("out.png")
71 .unwrap();
72 file.write_all(&img.to_bytes()).unwrap();
73}Source§impl SiImage
impl SiImage
Sourcepub fn load_preset(
&mut self,
preset: Box<SiPreset>,
values: HashMap<String, Box<dyn Any>>,
) -> &mut SiImage
pub fn load_preset( &mut self, preset: Box<SiPreset>, values: HashMap<String, Box<dyn Any>>, ) -> &mut SiImage
Load a preset. NOTE: It doesn’t work in WASM. Only for direct usage.
Examples found in repository?
examples/macros.rs (lines 26-33)
7fn main() {
8 // Create it with macro
9 preset! {
10 my_preset(img, font: SiFont, title: String, tagline: String) {
11 println!("{}", title);
12 let mut new = img;
13 render!(new: title; 480.0, 254.0; "font" &font, "scale" 64.0, "opts" &TextOptions::default(), "color" None);
14 render!(new: tagline; 480.0, 320.0; "font" &font, "scale" 48.0, "opts" &TextOptions::default(), "color" Some(String::from("#FFFFFF")));
15 new
16 }
17 };
18
19 // Use it
20 // Create the image
21 let mut img = SiImage::from_network("https://res.cloudinary.com/zype/image/upload/regraphic");
22 // Create the font
23 let font = SiFont::from_network(
24 "https://github.com/Zype-Z/ShareImage.js/raw/main/assets/fonts/sirin-stencil.ttf",
25 );
26 img.load_preset(
27 my_preset,
28 anymap! {
29 font: font,
30 title: "Hello, World!".to_string(),
31 tagline: "Cool!".to_string()
32 },
33 );
34 let mut file = fs::OpenOptions::new()
35 .create(true) // To create a new file
36 .write(true)
37 // either use the ? operator or unwrap since it returns a Result
38 .open("out.png")
39 .unwrap();
40 file.write_all(&img.to_bytes()).unwrap();
41}More examples
examples/preset.rs (line 65)
5fn main() {
6 // Create the preset
7 let preset = SiPreset::new(Box::new(|img, vals| {
8 let new_img = img.clone();
9 // img is the full image
10 println!("Dimensions: {}x{}", img.width(), img.height());
11 println!("Values: {:?}", vals);
12 // Get the font
13 let font = match vals.get("font") {
14 Some(font) => {
15 // Do type checking
16 if font.type_id() == std::any::TypeId::of::<SiFont>() {
17 // Downcast it
18 font.downcast_ref::<SiFont>().unwrap()
19 } else {
20 panic!(
21 "Expected type: {:?}\nFound type: {:?}",
22 std::any::TypeId::of::<SiFont>(),
23 font.type_id()
24 );
25 }
26 }
27 None => panic!("No font provided"),
28 };
29 // Render something on the image with that font
30 // Get the title
31 let title = match vals.get("title") {
32 Some(title) => {
33 // Do type checking
34 if title.type_id() == std::any::TypeId::of::<String>() {
35 // Downcast it
36 title.downcast_ref::<String>().unwrap()
37 } else {
38 panic!(
39 "Expected type: {:?}\nFound type: {:?}",
40 std::any::TypeId::of::<String>(),
41 title.type_id()
42 );
43 }
44 }
45 None => panic!("No title provided"),
46 };
47 let text_options = TextOptions::default();
48 // Render it
49 new_img.render_text(title, 64.0, 480.0, 254.0, None, font, &text_options)
50 }));
51
52 // Use it
53 // Create the image
54 let mut img = SiImage::from_network("https://res.cloudinary.com/zype/image/upload/regraphic");
55 // Create the font
56 let font = SiFont::from_network(
57 "https://github.com/Zype-Z/ShareImage.js/raw/main/assets/fonts/sirin-stencil.ttf",
58 );
59 let font_val: Box<dyn std::any::Any> = Box::new(font);
60 let title_val: Box<dyn std::any::Any> = Box::new("Hello, World!".to_string());
61 let values: HashMap<String, Box<dyn std::any::Any>> = HashMap::from([
62 ("font".to_string(), font_val),
63 ("title".to_string(), title_val),
64 ]);
65 img.load_preset(preset, values);
66 let mut file = fs::OpenOptions::new()
67 .create(true) // To create a new file
68 .write(true)
69 // either use the ? operator or unwrap since it returns a Result
70 .open("out.png")
71 .unwrap();
72 file.write_all(&img.to_bytes()).unwrap();
73}Trait Implementations§
Source§impl FromWasmAbi for SiImage
impl FromWasmAbi for SiImage
Source§impl IntoWasmAbi for SiImage
impl IntoWasmAbi for SiImage
Source§impl LongRefFromWasmAbi for SiImage
impl LongRefFromWasmAbi for SiImage
Source§impl OptionFromWasmAbi for SiImage
impl OptionFromWasmAbi for SiImage
Source§impl OptionIntoWasmAbi for SiImage
impl OptionIntoWasmAbi for SiImage
Source§impl RefFromWasmAbi for SiImage
impl RefFromWasmAbi for SiImage
Source§impl RefMutFromWasmAbi for SiImage
impl RefMutFromWasmAbi for SiImage
Source§impl TryFromJsValue for SiImage
impl TryFromJsValue for SiImage
Source§impl VectorFromWasmAbi for SiImage
impl VectorFromWasmAbi for SiImage
Source§impl VectorIntoWasmAbi for SiImage
impl VectorIntoWasmAbi for SiImage
impl SupportsConstructor for SiImage
impl SupportsInstanceProperty for SiImage
impl SupportsStaticProperty for SiImage
Auto Trait Implementations§
impl Freeze for SiImage
impl RefUnwindSafe for SiImage
impl Send for SiImage
impl Sync for SiImage
impl Unpin for SiImage
impl UnwindSafe for SiImage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.