Geo

Struct Geo 

Source
pub struct Geo { /* private fields */ }
Expand description

Geo fields can carry data about a specific location related to an event.

This geolocation information can be derived from techniques such as Geo IP, or be user-supplied.

Implementations§

Source§

impl Geo

Source

pub fn get_location(&self) -> Option<&GeoPoint>

Longitude and latitude.

Source

pub fn set_location(&mut self, location_arg: GeoPoint)

Longitude and latitude.

§Example

{ "lon": -73.614830, "lat": 45.505918 }

Source

pub fn get_continent_code(&self) -> Option<&String>

Two-letter code representing continent’s name.

Source

pub fn set_continent_code(&mut self, continent_code_arg: String)

Two-letter code representing continent’s name.

§Example

NA

Source

pub fn get_continent_name(&self) -> Option<&String>

Name of the continent.

Source

pub fn set_continent_name(&mut self, continent_name_arg: String)

Name of the continent.

§Example

North America

Source

pub fn get_country_name(&self) -> Option<&String>

Country name.

Source

pub fn set_country_name(&mut self, country_name_arg: String)

Country name.

§Example

Canada

Source

pub fn get_region_name(&self) -> Option<&String>

Region name.

Source

pub fn set_region_name(&mut self, region_name_arg: String)

Region name.

§Example

Quebec

Source

pub fn get_city_name(&self) -> Option<&String>

City name.

Source

pub fn set_city_name(&mut self, city_name_arg: String)

City name.

§Example

Montreal

Source

pub fn get_country_iso_code(&self) -> Option<&String>

Country ISO code.

Source

pub fn set_country_iso_code(&mut self, country_iso_code_arg: String)

Country ISO code.

§Example

CA

Source

pub fn get_postal_code(&self) -> Option<&String>

Postal code associated with the location.

Values appropriate for this field may also be known as a postcode or ZIP code and will vary widely from country to country.

Source

pub fn set_postal_code(&mut self, postal_code_arg: String)

Postal code associated with the location.

Values appropriate for this field may also be known as a postcode or ZIP code and will vary widely from country to country.

§Example

94040

Source

pub fn get_region_iso_code(&self) -> Option<&String>

Region ISO code.

Source

pub fn set_region_iso_code(&mut self, region_iso_code_arg: String)

Region ISO code.

§Example

CA-QC

Source

pub fn get_timezone(&self) -> Option<&String>

The time zone of the location, such as IANA time zone name.

Source

pub fn set_timezone(&mut self, timezone_arg: String)

The time zone of the location, such as IANA time zone name.

§Example

America/Argentina/Buenos_Aires

Source

pub fn get_name(&self) -> Option<&String>

User-defined description of a location, at the level of granularity they care about.

Could be the name of their data centers, the floor number, if this describes a local physical entity, city names.

Not typically used in automated geolocation.

Source

pub fn set_name(&mut self, name_arg: String)

User-defined description of a location, at the level of granularity they care about.

Could be the name of their data centers, the floor number, if this describes a local physical entity, city names.

Not typically used in automated geolocation.

§Example

boston-dc

Trait Implementations§

Source§

impl Clone for Geo

Source§

fn clone(&self) -> Geo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Geo

Source§

fn default() -> Geo

Returns the “default value” for a type. Read more
Source§

impl Serialize for Geo

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Geo

§

impl RefUnwindSafe for Geo

§

impl Send for Geo

§

impl Sync for Geo

§

impl Unpin for Geo

§

impl UnwindSafe for Geo

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.