pub struct Location { /* private fields */ }
Expand description
Location of a point on the map
Implementations§
Source§impl Location
impl Location
Sourcepub fn new(longitude: f32, latitude: f32) -> Self
pub fn new(longitude: f32, latitude: f32) -> Self
Creates a new location from a longitude/latitude
Sourcepub fn date_time(self, date_time: NaiveDateTime) -> Self
pub fn date_time(self, date_time: NaiveDateTime) -> Self
Expected date/time for the user to be at the location in the local time zone of departure or arrival.
Offers more granularity over setting time than the global Manifest::date_time
.
Note: This behaves differently for the matrix in comparison to the route API:
- If set on the sources and there’s more targets than sources, it will behave like a “Specified departure time” on the sources.
- If set on the targets and there’s less targets than sources, it will behave like a “Specified arrival time” on the targets.
Note: There are important limitations to time awareness. Due to algorithmic complexity, we disallow time-dependence for certain combinations of date_time on locations:
- when there are more sources than
target
s:Location::date_time
on anysource
- using
Self::date_time
withDateTime::from_current_departure_time
andDateTime::from_departure_time
- when there’s more or equal amount of
target
s than/assource
sLocation::date_time
on anytarget
DateTime::from_arrival_time
Trait Implementations§
Source§impl From<(f32, f32)> for Location
impl From<(f32, f32)> for Location
Source§fn from((longitude, latitude): Coordinate) -> Self
fn from((longitude, latitude): Coordinate) -> Self
Converts to this type from the input type.
Source§impl From<Location> for VerboseLocation
impl From<Location> for VerboseLocation
Source§impl From<VerboseLocation> for Location
impl From<VerboseLocation> for Location
Source§fn from(value: VerboseLocation) -> Self
fn from(value: VerboseLocation) -> Self
Converts to this type from the input type.
impl Copy 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