Struct gravatar::Gravatar

source ·
pub struct Gravatar { /* private fields */ }
Expand description

Representation of a single Gravatar image URL.

Implementations

Creates a new Gravatar with the given email and default values for the other parameters.

Sets the desired image size. If None is provided, then no size is passed to Gravatar, which will then use a default of 80px by 80px. Gravatar will only provide images between 1px and 2048px by size, so this function will use 1px if the desired size is less than that and 2048px if the desired size is greater than that.

For more information, see https://en.gravatar.com/site/implement/images/#size.

Default value: None

Sets the default image to use if the user does not have a Gravatar. If None is provided, then Gravatar returns a blue Gravatar logo. The default image can be either a URL or one of Gravatar’s premade defaults.

For more information, see https://en.gravatar.com/site/implement/images/#default-image.

Default value: None

If force_default is set to true, then Gravatar will always return the specified default image, whether or not the user’s email exists.

For more information, see https://en.gravatar.com/site/implement/images/#force-default.

Default value: false

Sets the maximum rating level for which Gravatar will show the user’s image. If None is provided, then Gravatar will only deliver “G”-rated images by default. If an image is at a higher rating level than the requested one, the default image is returned instead.

For more information, see https://en.gravatar.com/site/implement/images/#rating.

Default value: None

If ssl is set to true, Gravatar’s secure URL (https://secure.gravatar.com/avatar/…) is used. Otherwise, the non-SSL website is used instead (http://www.gravatar.com/avatar/…).

Default value: true

Returns the image URL of the user’s Gravatar with all specified parameters.

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

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

Returns the argument unchanged.

Calls U::from(self).

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

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.