pub struct ImageFile { /* private fields */ }
Expand description
An image file generator.
The minimum required setup methods are: width
,
height
and path
§Example
ImageFile::new()
.width(600)
.height(400)
.path("images/plotters-histogram.html")
.overwrite(true)
.title("the title")
.alt("the alt text")
.wrapper("div")
.wrapper_style("padding: 10px; background-color: red;")
.generate(my_generator_function)?;
Implementations§
Source§impl ImageFile
§Optional Configuration methods
impl ImageFile
§Optional Configuration methods
Sourcepub fn attr(self, attribute: &str, value: &str) -> Self
pub fn attr(self, attribute: &str, value: &str) -> Self
Sets the chosen attribute for the <img>
tag.
Valid attributes are: “alt”, “title”, “id”, “class”, “style”, …
Sourcepub fn wrapper_attr(self, attribute: &str, value: &str) -> Self
pub fn wrapper_attr(self, attribute: &str, value: &str) -> Self
Sets an attribute for the wrapper tag around <img>
.
Valid attributes are: “alt”, “title”, “id”, “class”, “style”… And if the wrapper is an anchor “a”, then “href” & “target”.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImageFile
impl RefUnwindSafe for ImageFile
impl Send for ImageFile
impl Sync for ImageFile
impl Unpin for ImageFile
impl UnwindSafe for ImageFile
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