/// Insert and OAuth credential using the entry trait and
/// returning the credential. This internally calls
/// `entry.(OAuthCredential).or_insret_with(value)`.
///
/// # Example
/// ```
/// # use graph_oauth::oauth::OAuth;
/// # use graph_oauth::oauth::OAuthCredential;
/// # let mut oauth = OAuth::new();
/// let entry = oauth.entry(OAuthCredential::AuthorizeURL, "https://example.com");
/// assert_eq!(entry, "https://example.com")
/// ```
Insert and OAuth credential using the entry trait and
returning the credential.
Insert and OAuth credential using the entry trait and returning the credential .
pub fn entry<V: ToString>(&mut self, oac: OAuthCredential, value: V) -> &mut String {
        let v = value.to_string();
        match oac {
            OAuthCredential::RefreshTokenURL
            | OAuthCredential::PostLogoutRedirectURI
            | OAuthCredential::AccessTokenURL
            | OAuthCredential::AuthorizeURL
            | OAuthCredential::LogoutURL => {
                Url::parse(v.as_ref()).unwrap();
            }
            _ => {}
        }
        self.credentials
            .entry(oac.alias().to_string())
            .or_insert_with(|| v)
    }
pub fn entry < V : ToString > ( & mut self , oac : OAuthCredential , value : V ) -> & mut String { let v = value . to_string ( ) ; match oac { OAuthCredential :: RefreshTokenURL | OAuthCredential :: PostLogoutRedirectURI | OAuthCredential :: AccessTokenURL | OAuthCredential :: AuthorizeURL | OAuthCredential :: LogoutURL => { Url :: parse ( v . as_ref ( ) ) . unwrap ( ) ; } _ => { } } self . credentials . entry ( oac . alias ( ) . to_string ( ) ) . or_insert_with ( | | v ) }
Insert and OAuth credential using the entry trait and
returning the credential.
Insert and OAuth credential using the entry trait and returning the credential .
&mut self
oac
OAuthCredential
value
V
example
None
use graph_oauth::oauth::oauth;
None
use graph_oauth::oauth::oauthcredential;
None
let mut oauth = oauth::new();
None