pub struct Destination { /* private fields */ }Expand description
A place to send to the car’s navigation with
Client::send_destination.
let office = hkconnect::Destination::new("Office", 12.9716, 77.5946)?.with_address("MG Road");Serializes with the field names name, latitude, longitude and
address; deserializing validates the coordinates like
Destination::new.
Implementations§
Source§impl Destination
impl Destination
Sourcepub fn new(
name: impl Into<String>,
latitude: f64,
longitude: f64,
) -> Result<Self>
pub fn new( name: impl Into<String>, latitude: f64, longitude: f64, ) -> Result<Self>
A named place, in degrees (WGS 84), with an empty address.
Fails with Error::InvalidCoordinates
unless the latitude is within -90..=90 and the longitude within
-180..=180.
Sourcepub fn with_address(self, address: impl Into<String>) -> Self
pub fn with_address(self, address: impl Into<String>) -> Self
Set the address shown on the car’s screen.
Trait Implementations§
Source§impl Clone for Destination
impl Clone for Destination
Source§impl Debug for Destination
impl Debug for Destination
Source§impl<'de> Deserialize<'de> for Destination
impl<'de> Deserialize<'de> for Destination
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for Destination
impl PartialEq for Destination
Source§impl Serialize for Destination
impl Serialize for Destination
impl StructuralPartialEq for Destination
Auto Trait Implementations§
impl Forget for Destination
impl Freeze for Destination
impl Move for Destination
impl RefUnwindSafe for Destination
impl Send for Destination
impl Sync for Destination
impl Unpin for Destination
impl UnsafeUnpin for Destination
impl UnwindSafe for Destination
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