pub struct Location {
pub country: Option<String>,
pub region: Option<String>,
pub city: Option<String>,
pub dma: Option<u16>,
pub provider: String,
}Expand description
The location information that providers must produce.
Fields§
§country: Option<String>Country in ISO 3166-1 alpha-2 format, such as “MX” for Mexico or “IT” for Italy.
region: Option<String>Region/region (e.g. a US state) in ISO 3166-2 format, such as “QC” for Quebec (with country = “CA”) or “TX” for Texas (with country = “US”).
city: Option<String>City, listed by name such as “Portland” or “Berlin”.
dma: Option<u16>The Designated Market Area code, as defined by Nielsen. Only defined in the US.
provider: StringThe name of the provider that produced this recommendation.
Implementations§
Source§impl Location
impl Location
Sourcepub fn build() -> LocationBuilder
pub fn build() -> LocationBuilder
Create a builder for a Location that can be assembled incrementally.
Sourcepub fn country(&self) -> String
pub fn country(&self) -> String
Get an owned copy of the country, or the default if the field is None
Sourcepub fn region(&self) -> String
pub fn region(&self) -> String
Get an owned copy of the region, or the default if the field is None
Trait Implementations§
Source§impl FromRequest for Location
impl FromRequest for Location
impl Eq for Location
impl StructuralPartialEq for Location
Auto Trait Implementations§
impl Freeze for Location
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnwindSafe for Location
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