Struct ::exo::Location

Overview

Representation of a location

Methods

fn new() -> Location

Creates a new empty Location.

async fn load_by_coordinates(lat: f64, lon: f64) -> Result

Tries to load a new location based upon the latitute and longitute. This calls the OpenStreetMap Api to resolve the cordinates to a address.

async fn validate(self) -> Result

Tries to validate and update the values of a location. When the validation fails, it throws an error. Otherwise it will update the location.

Protocols

protocol get house_number
let output = value.house_number

Allows a get operation to work.

protocol set house_number
value.house_number = input

Allows a set operation to work.

protocol get road
let output = value.road

Allows a get operation to work.

protocol set road
value.road = input

Allows a set operation to work.

protocol get town
let output = value.town

Allows a get operation to work.

protocol set town
value.town = input

Allows a set operation to work.

protocol get state
let output = value.state

Allows a get operation to work.

protocol set state
value.state = input

Allows a set operation to work.

protocol get postcode
let output = value.postcode

Allows a get operation to work.

protocol set postcode
value.postcode = input

Allows a set operation to work.

protocol get country
let output = value.country

Allows a get operation to work.

protocol set country
value.country = input

Allows a set operation to work.

protocol get lat
let output = value.lat

Allows a get operation to work.

protocol set lat
value.lat = input

Allows a set operation to work.

protocol get lon
let output = value.lon

Allows a get operation to work.

protocol set lon
value.lon = input

Allows a set operation to work.

protocol get validated
let output = value.validated

Allows a get operation to work.

protocol set validated
value.validated = input

Allows a set operation to work.

protocol partial_eq
if value == b { }

Allows for partial equality operations to work.

protocol string_debug
println("{:?}", value)

Allows the value to be debug printed.

protocol string_display
println("{}", value)

Allows the value to be display printed.