pub struct BingWebmasterClient { /* private fields */ }Expand description
Bing Webmaster API client for interacting with Bing Webmaster Tools
This client provides access to all methods from the Bing Webmaster API, allowing you to manage your websites, submit URLs, track crawl issues, and more.
Implementations§
Source§impl BingWebmasterClient
impl BingWebmasterClient
pub fn new(api_key: String) -> Self
Sourcepub fn with_base_url(api_key: String, base_url: String) -> Self
pub fn with_base_url(api_key: String, base_url: String) -> Self
Create a new WebmasterApiClient with default reqwest client
§Arguments
api_key- Your Bing Webmaster Tools API keybase_url- Optional custom base URL (defaults to official Bing API endpoint)
Sourcepub fn with_middleware(
api_key: String,
base_url: Option<String>,
client_builder: ClientBuilder,
) -> Self
pub fn with_middleware( api_key: String, base_url: Option<String>, client_builder: ClientBuilder, ) -> Self
Create a new WebmasterApiClient with custom middleware
§Arguments
api_key- Your Bing Webmaster Tools API keybase_url- Optional custom base URL (defaults to official Bing API endpoint)client_builder- ClientBuilder with configured middleware
§Examples
use bing_webmaster_api::BingWebmasterClient;
use reqwest::Client;
use reqwest_middleware::ClientBuilder;
let client_builder = ClientBuilder::new(Client::new());
let api_client = BingWebmasterClient::with_middleware(
"your-api-key".to_string(),
None,
client_builder
);pub async fn add_blocked_url( &self, site_url: &str, blocked_url: &BlockedUrl, ) -> Result<()>
pub async fn add_connected_page( &self, site_url: &str, master_url: &str, ) -> Result<()>
pub async fn add_country_region_settings( &self, site_url: &str, settings: &CountryRegionSettings, ) -> Result<()>
pub async fn add_deep_link_block( &self, site_url: &str, market: &str, search_url: &str, deep_link_url: &str, ) -> Result<()>
pub async fn add_query_parameter( &self, site_url: &str, query_parameter: &str, ) -> Result<()>
pub async fn add_site(&self, site_url: &str) -> Result<()>
pub async fn add_site_roles( &self, site_url: &str, delegated_url: &str, user_email: &str, authentication_code: &str, is_administrator: bool, is_read_only: bool, ) -> Result<()>
pub async fn enable_disable_query_parameter( &self, site_url: &str, parameter: &str, enabled: bool, ) -> Result<()>
pub async fn fetch_url(&self, site_url: &str, url: &str) -> Result<()>
Sourcepub async fn submit_content(
&self,
site_url: &str,
url: &str,
http_message: &str,
structured_data: &str,
dynamic_serving: i32,
) -> Result<()>
pub async fn submit_content( &self, site_url: &str, url: &str, http_message: &str, structured_data: &str, dynamic_serving: i32, ) -> Result<()>
Submit content
§Parameters
- siteUrl - Site url E.g.: http://example.com
- url - Url to submit E.g.: http://example.com/url1.html
- httpMessage - HTTP status line, such as HTTP/1.1 200 OK, HTTP Headers, an empty line and optional HTTP message body data equivalent of the response based64 encoded if bingbot was fetching this URL. The request/status line and headers must all end with
(that is, a carriage return followed by a line feed). The empty line must consist of only and no other whitespace. - structuredData - Structured Data (typically JSON-LD ) provided based64 encoded typically used for submitting to bing structured Data for non-HTML content types as images, PDF files.Empty if no structured data provided.
- dynamicServing - {none = 0, PC-laptop = 1, mobile = 2, AMP = 3, tablet = 4, non-visual browser = 5}. Set this field to a value greater than 0 only if your web site dynamically serves different content based on customer devices visiting your web site
pub async fn submit_url(&self, site_url: &str, url: &str) -> Result<()>
pub async fn submit_url_batch( &self, site_url: &str, url_list: &[String], ) -> Result<()>
pub async fn get_crawl_issues( &self, site_url: &str, ) -> Result<Vec<UrlWithCrawlIssues>>
pub async fn get_page_stats(&self, site_url: &str) -> Result<Vec<QueryStats>>
pub async fn get_connected_pages(&self, site_url: &str) -> Result<Vec<Site>>
pub async fn get_query_parameters( &self, site_url: &str, ) -> Result<Vec<QueryParameter>>
pub async fn get_crawl_stats(&self, site_url: &str) -> Result<Vec<CrawlStats>>
pub async fn verify_site(&self, site_url: &str) -> Result<bool>
pub async fn get_content_submission_quota( &self, site_url: &str, ) -> Result<ContentSubmissionQuota>
pub async fn get_blocked_urls(&self, site_url: &str) -> Result<Vec<BlockedUrl>>
pub async fn get_children_url_info( &self, site_url: &str, url: &str, page: u16, filter_properties: &FilterProperties, ) -> Result<Vec<UrlInfo>>
pub async fn get_children_url_traffic_info( &self, site_url: &str, url: &str, page: u16, ) -> Result<Vec<UrlTrafficInfo>>
pub async fn get_country_region_settings( &self, site_url: &str, ) -> Result<Vec<CountryRegionSettings>>
pub async fn get_crawl_settings(&self, site_url: &str) -> Result<CrawlSettings>
pub async fn get_deep_link(&self, site_url: &str, url: &str) -> Result<DeepLink>
pub async fn get_deep_link_algo_urls( &self, site_url: &str, ) -> Result<Vec<DeepLinkAlgoUrl>>
pub async fn get_deep_link_blocks( &self, site_url: &str, ) -> Result<Vec<DeepLinkBlock>>
pub async fn get_feed_details( &self, site_url: &str, feed_url: &str, ) -> Result<Vec<Feed>>
pub async fn get_feeds(&self, site_url: &str) -> Result<Vec<Feed>>
pub async fn get_fetched_url_details( &self, site_url: &str, url: &str, ) -> Result<FetchedUrlDetails>
pub async fn get_fetched_urls(&self, site_url: &str) -> Result<Vec<FetchedUrl>>
pub async fn get_keyword( &self, query: &str, country: &str, language: &str, start_date: DateTime<Utc>, end_date: DateTime<Utc>, ) -> Result<Vec<Keyword>>
pub async fn get_keyword_stats( &self, query: &str, country: &str, language: &str, ) -> Result<Vec<KeywordStats>>
pub async fn get_link_counts( &self, site_url: &str, page: i16, ) -> Result<LinkCounts>
pub async fn get_page_query_stats( &self, site_url: &str, page_url: &str, ) -> Result<Vec<QueryStats>>
pub async fn get_query_page_detail_stats( &self, site_url: &str, query: &str, page_url: &str, ) -> Result<Vec<DetailedQueryStats>>
pub async fn get_query_page_stats( &self, site_url: &str, query: &str, ) -> Result<Vec<QueryStats>>
pub async fn get_query_stats(&self, site_url: &str) -> Result<Vec<QueryStats>>
pub async fn get_query_traffic_stats( &self, site_url: &str, query: &str, ) -> Result<Vec<RankAndTrafficStats>>
pub async fn get_rank_and_traffic_stats( &self, site_url: &str, ) -> Result<Vec<RankAndTrafficStats>>
pub async fn get_site_moves(&self, site_url: &str) -> Result<Vec<SiteMove>>
pub async fn get_site_roles( &self, site_url: &str, include_all_subdomains: bool, ) -> Result<Vec<SiteRoles>>
pub async fn get_url_info(&self, site_url: &str, url: &str) -> Result<UrlInfo>
pub async fn get_url_links( &self, site_url: &str, link: &str, page: i16, ) -> Result<LinkDetails>
pub async fn get_url_submission_quota( &self, site_url: &str, ) -> Result<UrlSubmissionQuota>
pub async fn get_url_traffic_info( &self, site_url: &str, url: &str, ) -> Result<UrlTrafficInfo>
pub async fn get_user_sites(&self) -> Result<Vec<Site>>
pub async fn remove_blocked_url( &self, site_url: &str, blocked_url: &BlockedUrl, ) -> Result<()>
pub async fn remove_country_region_settings( &self, site_url: &str, settings: &CountryRegionSettings, ) -> Result<()>
pub async fn remove_deep_link_block( &self, site_url: &str, market: &str, search_url: &str, deep_link_url: &str, ) -> Result<()>
pub async fn remove_feed(&self, site_url: &str, feed_url: &str) -> Result<()>
pub async fn remove_query_parameter( &self, site_url: &str, query_parameter: &str, ) -> Result<()>
pub async fn remove_site(&self, site_url: &str) -> Result<()>
pub async fn remove_site_role( &self, site_url: &str, site_roles: &SiteRoles, ) -> Result<()>
pub async fn save_crawl_settings( &self, site_url: &str, crawl_settings: &CrawlSettings, ) -> Result<()>
pub async fn submit_feed(&self, site_url: &str, feed_url: &str) -> Result<()>
pub async fn submit_site_move( &self, site_url: &str, site_move_settings: &SiteMoveSettings, ) -> Result<()>
pub async fn update_deep_link( &self, site_url: &str, market: &str, search_url: &str, deep_link_weight: &DeepLinkWeight, ) -> Result<()>
Trait Implementations§
Source§impl Clone for BingWebmasterClient
impl Clone for BingWebmasterClient
Source§fn clone(&self) -> BingWebmasterClient
fn clone(&self) -> BingWebmasterClient
Returns a duplicate of the value. Read more
1.0.0§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 BingWebmasterClient
impl !RefUnwindSafe for BingWebmasterClient
impl Send for BingWebmasterClient
impl Sync for BingWebmasterClient
impl Unpin for BingWebmasterClient
impl !UnwindSafe for BingWebmasterClient
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)