Struct docima::ImageFile[][src]

pub struct ImageFile { /* fields omitted */ }
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

Start configuring a new image.

Finishes the image, calling the generator function and saving the file.

Sets the width of the image.

Sets the height of the image.

Sets the name and path of the output file, including the path from the project’s root.

Sets the chosen attribute for the <img> tag.

Valid attributes are: “alt”, “title”, “id”, “class”, “style”, …

Sets the wrapper HTML tag around <img>.

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”.

Sets the overwrite preference for the generated image.

If false the image will only be generated if the chosen output file doesn’t already exist. If true the image will always be generated, and the file overwritten.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.