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 <img> alt attribute.

Sets the <img> title attribute.

Sets the <img> id attribute.

Sets the <img> class attribute.

Sets the <img> style attribute.

Sets the wrapper HTML tag around <img>.

Sets the wrapper tag alt attribute.

Sets the wrapper tag title attribute.

Sets the wrapper tag id attribute.

Sets the wrapper tag class attribute.

Sets the wrapper tag style attribute.

Sets the wrapper tag href attribute.

The wrapper must be an anchor tag (a) in order for this to be used.

Sets the wrapper tag target attribute.

The wrapper must be an anchor tag (a) in order for this to be used.

Sets the wrapper tag style attribute.

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.