pub struct HttpClient { /* private fields */ }Expand description
Default client using public iTunes Search plus native authenticated store ops.
Implementations§
Source§impl HttpClient
impl HttpClient
Sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
examples/search.rs (line 14)
9fn main() {
10 let query = std::env::args()
11 .nth(1)
12 .unwrap_or_else(|| "calculator".into());
13 let country = std::env::var("IPATOOL_COUNTRY").unwrap_or_else(|_| "us".into());
14 let client = HttpClient::new().with_country(&country);
15
16 match client.search(&query, 5, None) {
17 Ok(results) => {
18 for app in results.results {
19 println!("{:>12} {} ({})", app.id, app.name, app.bundle_id);
20 }
21 }
22 Err(e) => {
23 eprintln!("search failed: {e}");
24 std::process::exit(1);
25 }
26 }
27}Sourcepub fn with_country(self, country: impl Into<String>) -> Self
pub fn with_country(self, country: impl Into<String>) -> Self
Examples found in repository?
examples/search.rs (line 14)
9fn main() {
10 let query = std::env::args()
11 .nth(1)
12 .unwrap_or_else(|| "calculator".into());
13 let country = std::env::var("IPATOOL_COUNTRY").unwrap_or_else(|_| "us".into());
14 let client = HttpClient::new().with_country(&country);
15
16 match client.search(&query, 5, None) {
17 Ok(results) => {
18 for app in results.results {
19 println!("{:>12} {} ({})", app.id, app.name, app.bundle_id);
20 }
21 }
22 Err(e) => {
23 eprintln!("search failed: {e}");
24 std::process::exit(1);
25 }
26 }
27}Trait Implementations§
Source§impl AppStoreClient for HttpClient
impl AppStoreClient for HttpClient
fn login(&self, req: &LoginRequest) -> Result<AuthInfo>
fn auth_info(&self, _keychain_passphrase: Option<&str>) -> Result<AuthInfo>
fn revoke(&self) -> Result<()>
fn search( &self, term: &str, limit: u32, _keychain_passphrase: Option<&str>, ) -> Result<SearchResult>
fn purchase( &self, app_id: Option<i64>, _bundle_id: Option<&str>, _keychain_passphrase: Option<&str>, ) -> Result<()>
fn download(&self, req: &DownloadRequest) -> Result<String>
fn list_versions( &self, app_id: Option<i64>, _bundle_id: Option<&str>, _keychain_passphrase: Option<&str>, ) -> Result<Vec<String>>
fn get_version_metadata( &self, app_id: Option<i64>, _bundle_id: Option<&str>, external_version_id: &str, _keychain_passphrase: Option<&str>, ) -> Result<VersionInfo>
fn list_purchases( &self, _keychain_passphrase: Option<&str>, ) -> Result<Vec<OwnedApp>>
Source§impl Clone for HttpClient
impl Clone for HttpClient
Source§impl Debug for HttpClient
impl Debug for HttpClient
Auto Trait Implementations§
impl Freeze for HttpClient
impl RefUnwindSafe for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin for HttpClient
impl UnsafeUnpin for HttpClient
impl UnwindSafe for HttpClient
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