pub struct Identicon { /* private fields */ }
Expand description

Generic Identicon struct

This is the base struct to be used.

Implementations

Generates a new identicon

The defaults are:

  • border: 50
  • size: 5
  • scale: 500
  • background_color: (240, 240, 240)
  • mirrored: true

Gets the identicon border size.

Sets the identicon border size.

Default is 5

Gets the identicon size

Sets the number of viewable blocks of the identicon.

This must be <= the scale.

Default is 5x5

Gets the identicon scale

Sets the scale of the image.

The scale plus 2 times the border is the final pixel size of the image.

This must be >= the size.

Default is 500

Gets the identicon background color

Sets the background, non-active color of the identicon.

This is a tuble of (red, green, blue) values.

Default is (240, 240, 240)

Gets if the identicon is mirrored

Sets whether the identicon is mirrored along the y axis.

This is a boolean.

Default is true

Generates the DynamicImage representing the Identicon

Saves the generated image to the given filename

The file formats .png, .jpg, .jpeg, .bmp, and .ico work.

Export a PNG file buffer as a Vec

This is for creating a file for a buffer or network response without creating a file on the filesystem.

Export a JPEG file buffer as a Vec

This is for creating a file for a buffer or network response without creating a file on the filesystem.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Convert the source color to the destination color using the specified method Read more

Convert the source color to the destination color using the bradford method by default Read more

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Convert into T with values clamped to the color defined bounds Read more

Convert into T. The resulting color might be invalid in its color space Read more

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more