pub struct Avatars { /* private fields */ }Implementations§
Source§impl Avatars
impl Avatars
pub fn new(client: &Client) -> Self
Sourcepub fn get_browser(
&self,
code: &str,
width: Option<i64>,
height: Option<i64>,
quality: Option<i64>,
) -> Result<Vec<u8>, AppwriteException>
pub fn get_browser( &self, code: &str, width: Option<i64>, height: Option<i64>, quality: Option<i64>, ) -> Result<Vec<u8>, AppwriteException>
You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user /account/sessions endpoint. Use width, height and quality arguments to change the output settings.
Sourcepub fn get_credit_card(
&self,
code: &str,
width: Option<i64>,
height: Option<i64>,
quality: Option<i64>,
) -> Result<Vec<u8>, AppwriteException>
pub fn get_credit_card( &self, code: &str, width: Option<i64>, height: Option<i64>, quality: Option<i64>, ) -> Result<Vec<u8>, AppwriteException>
The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
Sourcepub fn get_favicon(&self, url: &str) -> Result<Vec<u8>, AppwriteException>
pub fn get_favicon(&self, url: &str) -> Result<Vec<u8>, AppwriteException>
Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
Sourcepub fn get_flag(
&self,
code: &str,
width: Option<i64>,
height: Option<i64>,
quality: Option<i64>,
) -> Result<Vec<u8>, AppwriteException>
pub fn get_flag( &self, code: &str, width: Option<i64>, height: Option<i64>, quality: Option<i64>, ) -> Result<Vec<u8>, AppwriteException>
You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings.
Sourcepub fn get_image(
&self,
url: &str,
width: Option<i64>,
height: Option<i64>,
) -> Result<Vec<u8>, AppwriteException>
pub fn get_image( &self, url: &str, width: Option<i64>, height: Option<i64>, ) -> Result<Vec<u8>, AppwriteException>
Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
Sourcepub fn get_initials(
&self,
name: Option<&str>,
width: Option<i64>,
height: Option<i64>,
color: Option<&str>,
background: Option<&str>,
) -> Result<Vec<u8>, AppwriteException>
pub fn get_initials( &self, name: Option<&str>, width: Option<i64>, height: Option<i64>, color: Option<&str>, background: Option<&str>, ) -> Result<Vec<u8>, AppwriteException>
Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the ‘name’ parameter. If no name is given and no user is logged, an empty avatar will be returned.
You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user’s initials when reloading the same theme will always return for the same initials.