pub struct Options { /* private fields */ }Expand description
Options accepted by lookup calls and by the client as defaults.
Every field is optional. Per-call options always override the defaults stored on the client.
§Example
use ipwhois::Options;
let opts = Options::new()
.with_lang("en")
.with_fields(["success", "country", "city", "flag.emoji"])
.with_security(true)
.with_rate(true);Implementations§
Source§impl Options
impl Options
Sourcepub fn with_lang(self, lang: impl Into<String>) -> Self
pub fn with_lang(self, lang: impl Into<String>) -> Self
Set the response language.
Must be one of crate::SUPPORTED_LANGUAGES. Validated when the
call is made — invalid values surface as
crate::Error::InvalidArgument, no request is sent.
Sourcepub fn with_fields<I, S>(self, fields: I) -> Self
pub fn with_fields<I, S>(self, fields: I) -> Self
Restrict the response to a specific set of fields.
Include "success" if you rely on the success flag for error
checking — when fields is set, the API only returns the fields
you ask for.
Sourcepub fn with_security(self, enabled: bool) -> Self
pub fn with_security(self, enabled: bool) -> Self
Toggle the threat-detection (security) block in responses.
Requires the Business plan or above.
Trait Implementations§
impl Eq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl UnwindSafe for Options
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