Struct iplocate::Lookup [−][src]
pub struct Lookup<'a> { /* fields omitted */ }
This type allows customization of lookup
function.
Methods
impl<'a> Lookup<'a>
[src]
impl<'a> Lookup<'a>
pub fn new(ip: IpAddr) -> Self
[src]
pub fn new(ip: IpAddr) -> Self
Constructs a new Lookup
.
pub fn format(&mut self, value: Format) -> &mut Self
[src]
pub fn format(&mut self, value: Format) -> &mut Self
Sets the response's format.
pub fn apikey(&mut self, value: &'a str) -> &mut Self
[src]
pub fn apikey(&mut self, value: &'a str) -> &mut Self
Sets the IPLocate API's key.
pub fn callback(&mut self, value: &'a str) -> &mut Self
[src]
pub fn callback(&mut self, value: &'a str) -> &mut Self
Sets the JSONP callback.
pub fn raw_lookup(&self) -> Result<String>
[src]
pub fn raw_lookup(&self) -> Result<String>
Requests for data without deserializing its content. Returns a String
on success.
pub fn lookup(&self) -> Result<IpLocate>
[src]
pub fn lookup(&self) -> Result<IpLocate>
Requests for data and deserializes its content. Returns an IpLocate
on success.
By default, this method sets self.format
to be JSON type and self.callback
to be
empty. Otherwise, it would panic at runtime.