pub struct UserMap {
pub id: Vec<String>,
pub name: Vec<String>,
pub email: Vec<String>,
pub avatar: Vec<String>,
pub avatar_template: Option<String>,
}Expand description
Where a provider keeps each field of a user profile.
Candidates are tried in order, so ["name", "login"] means “the real name
if there is one, otherwise the handle” — which is what GitHub needs, because
name is optional there and frequently null.
Fields§
§id: Vec<String>§name: Vec<String>§email: Vec<String>§avatar: Vec<String>§avatar_template: Option<String>How to turn the avatar field into a URL, when it is not one already.
Discord sends an image hash; the URL is assembled from it and the
user id. {id} and {avatar} are substituted.
Implementations§
Source§impl UserMap
impl UserMap
pub fn new() -> UserMap
pub fn id<I: IntoIterator<Item = S>, S: Into<String>>(self, paths: I) -> UserMap
pub fn name<I: IntoIterator<Item = S>, S: Into<String>>( self, paths: I, ) -> UserMap
pub fn email<I: IntoIterator<Item = S>, S: Into<String>>( self, paths: I, ) -> UserMap
pub fn avatar<I: IntoIterator<Item = S>, S: Into<String>>( self, paths: I, ) -> UserMap
pub fn avatar_from(self, template: impl Into<String>) -> UserMap
Trait Implementations§
impl Eq for UserMap
impl StructuralPartialEq for UserMap
Auto Trait Implementations§
impl Freeze for UserMap
impl RefUnwindSafe for UserMap
impl Send for UserMap
impl Sync for UserMap
impl Unpin for UserMap
impl UnsafeUnpin for UserMap
impl UnwindSafe for UserMap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more