BingWebmasterClient

Struct BingWebmasterClient 

Source
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

Source

pub fn new(api_key: String) -> Self

Source

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 key
  • base_url - Optional custom base URL (defaults to official Bing API endpoint)
Source

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 key
  • base_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
);
Source

pub async fn add_blocked_url( &self, site_url: &str, blocked_url: &BlockedUrl, ) -> Result<()>

Source

pub async fn add_connected_page( &self, site_url: &str, master_url: &str, ) -> Result<()>

Source

pub async fn add_country_region_settings( &self, site_url: &str, settings: &CountryRegionSettings, ) -> Result<()>

Source

pub async fn add_query_parameter( &self, site_url: &str, query_parameter: &str, ) -> Result<()>

Source

pub async fn add_site(&self, site_url: &str) -> Result<()>

Source

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<()>

Source

pub async fn enable_disable_query_parameter( &self, site_url: &str, parameter: &str, enabled: bool, ) -> Result<()>

Source

pub async fn fetch_url(&self, site_url: &str, url: &str) -> Result<()>

Source

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
Source

pub async fn submit_url(&self, site_url: &str, url: &str) -> Result<()>

Source

pub async fn submit_url_batch( &self, site_url: &str, url_list: &[String], ) -> Result<()>

Source

pub async fn get_crawl_issues( &self, site_url: &str, ) -> Result<Vec<UrlWithCrawlIssues>>

Source

pub async fn get_page_stats(&self, site_url: &str) -> Result<Vec<QueryStats>>

Source

pub async fn get_connected_pages(&self, site_url: &str) -> Result<Vec<Site>>

Source

pub async fn get_query_parameters( &self, site_url: &str, ) -> Result<Vec<QueryParameter>>

Source

pub async fn get_crawl_stats(&self, site_url: &str) -> Result<Vec<CrawlStats>>

Source

pub async fn verify_site(&self, site_url: &str) -> Result<bool>

Source

pub async fn get_content_submission_quota( &self, site_url: &str, ) -> Result<ContentSubmissionQuota>

Source

pub async fn get_blocked_urls(&self, site_url: &str) -> Result<Vec<BlockedUrl>>

Source

pub async fn get_children_url_info( &self, site_url: &str, url: &str, page: u16, filter_properties: &FilterProperties, ) -> Result<Vec<UrlInfo>>

Source

pub async fn get_children_url_traffic_info( &self, site_url: &str, url: &str, page: u16, ) -> Result<Vec<UrlTrafficInfo>>

Source

pub async fn get_country_region_settings( &self, site_url: &str, ) -> Result<Vec<CountryRegionSettings>>

Source

pub async fn get_crawl_settings(&self, site_url: &str) -> Result<CrawlSettings>

Source

pub async fn get_feed_details( &self, site_url: &str, feed_url: &str, ) -> Result<Vec<Feed>>

Source

pub async fn get_feeds(&self, site_url: &str) -> Result<Vec<Feed>>

Source

pub async fn get_fetched_url_details( &self, site_url: &str, url: &str, ) -> Result<FetchedUrlDetails>

Source

pub async fn get_fetched_urls(&self, site_url: &str) -> Result<Vec<FetchedUrl>>

Source

pub async fn get_keyword( &self, query: &str, country: &str, language: &str, start_date: DateTime<Utc>, end_date: DateTime<Utc>, ) -> Result<Vec<Keyword>>

Source

pub async fn get_keyword_stats( &self, query: &str, country: &str, language: &str, ) -> Result<Vec<KeywordStats>>

Source

pub async fn get_page_query_stats( &self, site_url: &str, page_url: &str, ) -> Result<Vec<QueryStats>>

Source

pub async fn get_query_page_detail_stats( &self, site_url: &str, query: &str, page_url: &str, ) -> Result<Vec<DetailedQueryStats>>

Source

pub async fn get_query_page_stats( &self, site_url: &str, query: &str, ) -> Result<Vec<QueryStats>>

Source

pub async fn get_query_stats(&self, site_url: &str) -> Result<Vec<QueryStats>>

Source

pub async fn get_query_traffic_stats( &self, site_url: &str, query: &str, ) -> Result<Vec<RankAndTrafficStats>>

Source

pub async fn get_rank_and_traffic_stats( &self, site_url: &str, ) -> Result<Vec<RankAndTrafficStats>>

Source

pub async fn get_site_moves(&self, site_url: &str) -> Result<Vec<SiteMove>>

Source

pub async fn get_site_roles( &self, site_url: &str, include_all_subdomains: bool, ) -> Result<Vec<SiteRoles>>

Source

pub async fn get_url_info(&self, site_url: &str, url: &str) -> Result<UrlInfo>

Source

pub async fn get_url_submission_quota( &self, site_url: &str, ) -> Result<UrlSubmissionQuota>

Source

pub async fn get_url_traffic_info( &self, site_url: &str, url: &str, ) -> Result<UrlTrafficInfo>

Source

pub async fn get_user_sites(&self) -> Result<Vec<Site>>

Source

pub async fn remove_blocked_url( &self, site_url: &str, blocked_url: &BlockedUrl, ) -> Result<()>

Source

pub async fn remove_country_region_settings( &self, site_url: &str, settings: &CountryRegionSettings, ) -> Result<()>

Source

pub async fn remove_feed(&self, site_url: &str, feed_url: &str) -> Result<()>

Source

pub async fn remove_query_parameter( &self, site_url: &str, query_parameter: &str, ) -> Result<()>

Source

pub async fn remove_site(&self, site_url: &str) -> Result<()>

Source

pub async fn remove_site_role( &self, site_url: &str, site_roles: &SiteRoles, ) -> Result<()>

Source

pub async fn save_crawl_settings( &self, site_url: &str, crawl_settings: &CrawlSettings, ) -> Result<()>

Source

pub async fn submit_feed(&self, site_url: &str, feed_url: &str) -> Result<()>

Source

pub async fn submit_site_move( &self, site_url: &str, site_move_settings: &SiteMoveSettings, ) -> Result<()>

Trait Implementations§

Source§

impl Clone for BingWebmasterClient

Source§

fn clone(&self) -> BingWebmasterClient

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BingWebmasterClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more