pub struct Gravatar { /* private fields */ }
Expand description
Representation of a single Gravatar image URL.
Implementations
sourceimpl Gravatar
impl Gravatar
sourcepub fn new(email: &str) -> Gravatar
pub fn new(email: &str) -> Gravatar
Creates a new Gravatar with the given email and default values for the other parameters.
sourcepub fn set_size(&mut self, size: Option<u16>) -> &mut Self
pub fn set_size(&mut self, size: Option<u16>) -> &mut Self
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
sourcepub fn set_default(&mut self, default: Option<Default>) -> &mut Self
pub fn set_default(&mut self, default: Option<Default>) -> &mut Self
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
sourcepub fn set_force_default(&mut self, force_default: bool) -> &mut Self
pub fn set_force_default(&mut self, force_default: bool) -> &mut Self
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
sourcepub fn set_rating(&mut self, rating: Option<Rating>) -> &mut Self
pub fn set_rating(&mut self, rating: Option<Rating>) -> &mut Self
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