GPS

Struct GPS 

Source
pub struct GPS {
    pub version: Value,
    pub watch: Value,
    pub devices: Value,
    /* private fields */
}
Expand description

This struct holds the connection to the gpsd socket server and version, watch and devices information from gpsd. For more information about version, watch and devices visit https://gpsd.io/gpsd_json.html.

Fields§

§version: Value

The daemon ships a VERSION response to each client when the client first connects to it. Object is in json format.

§watch: Value

It also sets or elicits a report of per-subscriber policy and the raw bit. Object is in json format.

§devices: Value

Device list object in json format.

Implementations§

Source§

impl GPS

Source

pub fn connect() -> Result<GPS, GPSError>

Connects to the gpsd socket server. Returns a Result of either a GPS or GPSError.

Source

pub fn current_data(&mut self) -> Result<GPSData, GPSError>

Polls the gpsd socket server for the gps data. Returns a Result that is either GPSData or GPSError.

Source

pub fn close(self)

Close the connection to the gpsd socket server.

Trait Implementations§

Source§

impl Debug for GPS

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for GPS

§

impl RefUnwindSafe for GPS

§

impl Send for GPS

§

impl Sync for GPS

§

impl Unpin for GPS

§

impl UnwindSafe for GPS

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> 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, 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.