pub struct QueryConfig {
pub url: String,
pub client_id: String,
pub client_secret: String,
pub email: String,
pub password: String,
pub access_token: Option<String>,
pub refresh_token: Option<String>,
}Expand description
Represents the authentication configuration for a service.
This structure holds various credentials and tokens necessary for authenticating with a specific service. It includes the service’s URL, user credentials, and tokens used for accessing protected resources.
§Fields
url- AStringrepresenting the URL of the service to which queries will be sent.email- AStringrepresenting the user’s email address used for authentication.region- ARegionenum representing the region of the service.password- AStringrepresenting the user’s password used for authentication.access_token- AnOption<String>that holds the access token if available. This token is used to authenticate queries. It can beNoneif the token has not been acquired yet.refresh_token- AnOption<String>that holds the refresh token if available. This token is used to obtain a new access token when the current one expires. It can beNoneif the token has not been acquired yet.
§Examples
use discovery_connect::{QueryConfig};
let query_config = QueryConfig {
client_id: "client_id".to_string(),
client_secret: "client_secret".to_string(),
url: "https://api.europe.discovery.retinai.com".to_string(),
email: "user@example.com".to_string(),
password: "password123".to_string(),
access_token: None,
refresh_token: None,
};Fields§
§url: String§client_id: String§client_secret: String§email: String§password: String§access_token: Option<String>§refresh_token: Option<String>Trait Implementations§
Source§impl Clone for QueryConfig
impl Clone for QueryConfig
Source§fn clone(&self) -> QueryConfig
fn clone(&self) -> QueryConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QueryConfig
impl RefUnwindSafe for QueryConfig
impl Send for QueryConfig
impl Sync for QueryConfig
impl Unpin for QueryConfig
impl UnwindSafe for QueryConfig
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