pub struct Spider {
pub api_key: String,
pub client: Client,
}Expand description
Represents a Spider with API key and HTTP client.
Fields§
§api_key: StringThe Spider API key.
client: ClientThe Spider Client to re-use.
Implementations§
Source§impl Spider
impl Spider
Sourcepub fn new_with_client(
api_key: Option<String>,
client: Client,
) -> Result<Self, &'static str>
pub fn new_with_client( api_key: Option<String>, client: Client, ) -> Result<Self, &'static str>
Sourcepub async fn scrape_url(
&self,
url: &str,
params: Option<RequestParams>,
content_type: &str,
) -> Result<Value, Error>
pub async fn scrape_url( &self, url: &str, params: Option<RequestParams>, content_type: &str, ) -> Result<Value, Error>
Sourcepub async fn crawl_url(
&self,
url: &str,
params: Option<RequestParams>,
stream: bool,
content_type: &str,
callback: Option<impl Fn(Value) + Send>,
) -> Result<Value, Error>
pub async fn crawl_url( &self, url: &str, params: Option<RequestParams>, stream: bool, content_type: &str, callback: Option<impl Fn(Value) + Send>, ) -> Result<Value, Error>
Sourcepub async fn links(
&self,
url: &str,
params: Option<RequestParams>,
_stream: bool,
content_type: &str,
) -> Result<Value, Error>
pub async fn links( &self, url: &str, params: Option<RequestParams>, _stream: bool, content_type: &str, ) -> Result<Value, Error>
Sourcepub async fn screenshot(
&self,
url: &str,
params: Option<RequestParams>,
_stream: bool,
content_type: &str,
) -> Result<Value, Error>
pub async fn screenshot( &self, url: &str, params: Option<RequestParams>, _stream: bool, content_type: &str, ) -> Result<Value, Error>
Sourcepub async fn search(
&self,
q: &str,
params: Option<SearchRequestParams>,
_stream: bool,
content_type: &str,
) -> Result<Value, Error>
pub async fn search( &self, q: &str, params: Option<SearchRequestParams>, _stream: bool, content_type: &str, ) -> Result<Value, Error>
Sourcepub async fn transform(
&self,
data: Vec<HashMap<&str, &str>>,
params: Option<TransformParams>,
_stream: bool,
content_type: &str,
) -> Result<Value, Error>
pub async fn transform( &self, data: Vec<HashMap<&str, &str>>, params: Option<TransformParams>, _stream: bool, content_type: &str, ) -> Result<Value, Error>
Sourcepub async fn extract_contacts(
&self,
url: &str,
params: Option<RequestParams>,
_stream: bool,
content_type: &str,
) -> Result<Value, Error>
pub async fn extract_contacts( &self, url: &str, params: Option<RequestParams>, _stream: bool, content_type: &str, ) -> Result<Value, Error>
Sourcepub async fn label(
&self,
url: &str,
params: Option<RequestParams>,
_stream: bool,
content_type: &str,
) -> Result<Value, Error>
pub async fn label( &self, url: &str, params: Option<RequestParams>, _stream: bool, content_type: &str, ) -> Result<Value, Error>
Sourcepub async fn download(
&self,
url: Option<&str>,
options: Option<HashMap<&str, i32>>,
) -> Result<Response, Error>
pub async fn download( &self, url: Option<&str>, options: Option<HashMap<&str, i32>>, ) -> Result<Response, Error>
Sourcepub async fn create_signed_url(
&self,
url: Option<&str>,
options: Option<HashMap<&str, i32>>,
) -> Result<Value, Error>
pub async fn create_signed_url( &self, url: Option<&str>, options: Option<HashMap<&str, i32>>, ) -> Result<Value, Error>
Sourcepub async fn get_crawl_state(
&self,
url: &str,
params: Option<RequestParams>,
content_type: &str,
) -> Result<Value, Error>
pub async fn get_crawl_state( &self, url: &str, params: Option<RequestParams>, content_type: &str, ) -> Result<Value, Error>
Sourcepub async fn get_credits(&self) -> Result<Value, Error>
pub async fn get_credits(&self) -> Result<Value, Error>
Get the account credits left.
Sourcepub async fn data_post(
&self,
table: &str,
data: Option<RequestParams>,
) -> Result<Value, Error>
pub async fn data_post( &self, table: &str, data: Option<RequestParams>, ) -> Result<Value, Error>
Send a request for a data record.
Sourcepub async fn query(&self, params: &QueryRequest) -> Result<Value, Error>
pub async fn query(&self, params: &QueryRequest) -> Result<Value, Error>
Query a record from the global DB.
Sourcepub async fn data_get(
&self,
table: &str,
params: Option<RequestParams>,
) -> Result<Value, Error>
pub async fn data_get( &self, table: &str, params: Option<RequestParams>, ) -> Result<Value, Error>
Get a table record.
Sourcepub async fn data_delete(
&self,
table: &str,
params: Option<RequestParams>,
) -> Result<Value, Error>
pub async fn data_delete( &self, table: &str, params: Option<RequestParams>, ) -> Result<Value, Error>
Delete a record.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Spider
impl !RefUnwindSafe for Spider
impl Send for Spider
impl Sync for Spider
impl Unpin for Spider
impl !UnwindSafe for Spider
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