pub struct WebSearchLocation { /* private fields */ }Expand description
Bounded approximate user location for hosted web search.
Implementations§
Source§impl WebSearchLocation
impl WebSearchLocation
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates an empty location that can be populated through validated builders.
Sourcepub fn with_country(
self,
country: impl Into<String>,
) -> Result<Self, ModelRequestError>
pub fn with_country( self, country: impl Into<String>, ) -> Result<Self, ModelRequestError>
Sets an ISO 3166-1 alpha-2 uppercase country code.
§Errors
Returns an error when the value is not exactly two uppercase ASCII letters.
Sourcepub fn with_city(
self,
city: impl Into<String>,
) -> Result<Self, ModelRequestError>
pub fn with_city( self, city: impl Into<String>, ) -> Result<Self, ModelRequestError>
Sets a bounded city name.
§Errors
Returns an error for empty, oversized, or control-containing text.
Sourcepub fn with_region(
self,
region: impl Into<String>,
) -> Result<Self, ModelRequestError>
pub fn with_region( self, region: impl Into<String>, ) -> Result<Self, ModelRequestError>
Sets a bounded region name.
§Errors
Returns an error for empty, oversized, or control-containing text.
Sourcepub fn with_timezone(
self,
timezone: impl Into<String>,
) -> Result<Self, ModelRequestError>
pub fn with_timezone( self, timezone: impl Into<String>, ) -> Result<Self, ModelRequestError>
Sets a canonical IANA-style timezone name.
§Errors
Returns an error for empty, oversized, or non-canonical text.
Trait Implementations§
Source§impl Clone for WebSearchLocation
impl Clone for WebSearchLocation
Source§fn clone(&self) -> WebSearchLocation
fn clone(&self) -> WebSearchLocation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WebSearchLocation
impl Debug for WebSearchLocation
Source§impl Default for WebSearchLocation
impl Default for WebSearchLocation
Source§fn default() -> WebSearchLocation
fn default() -> WebSearchLocation
Returns the “default value” for a type. Read more
impl Eq for WebSearchLocation
Source§impl PartialEq for WebSearchLocation
impl PartialEq for WebSearchLocation
impl StructuralPartialEq for WebSearchLocation
Auto Trait Implementations§
impl Freeze for WebSearchLocation
impl RefUnwindSafe for WebSearchLocation
impl Send for WebSearchLocation
impl Sync for WebSearchLocation
impl Unpin for WebSearchLocation
impl UnsafeUnpin for WebSearchLocation
impl UnwindSafe for WebSearchLocation
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