pub struct QueryClient {
pub config: Mutex<QueryConfig>,
pub client: Client,
}Expand description
Encapsulates a client for performing authenticated queries to a service.
§Fields
client- An instance ofreqwest::Clientused for making HTTP requests.config- AMutex<QueryConfig>that holds the authentication configuration. TheMutexensures that the configuration can be safely accessed and modified across multiple threads.
§Examples
use discovery_connect::{QueryClient, QueryConfig};
use std::sync::Mutex;
let query_client = QueryClient {
client: reqwest::Client::new(),
config: Mutex::new(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§
§config: Mutex<QueryConfig>§client: ClientImplementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for QueryClient
impl !RefUnwindSafe for QueryClient
impl Send for QueryClient
impl Sync for QueryClient
impl Unpin for QueryClient
impl !UnwindSafe for QueryClient
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