Struct mercury::Mercury
[−]
[src]
pub struct Mercury(_);
A client used to make requests to the Mercury Parser.
Methods
impl Mercury
[src]
fn new(handle: &Handle, key: String) -> Result<Mercury, Error>
[src]
Create a new Mercury client.
Example
let core = Core::new()?; let handle = core.handle(); let key = env::var("MERCURY_API_KEY")?; let client = Mercury::new(&handle, key)?;
fn handle(&self) -> &Handle
[src]
Return a reference to a handle to the event loop this client is associated with.
fn key(&self) -> &str
[src]
Returns a reference to the API key associated with this client.
fn parse(&self, resource: &str) -> Response
[src]
Send a request to the Mercury Parser API using this client.
Example
let future = client.parse("https://example.com").inspect(|article| { println!("{:#?}", article); });