Skip to main content

Device

Struct Device 

pub struct Device {
Show 15 fields pub activated: Option<DateTime<Utc>>, pub bps: Option<u32>, pub cycle: Option<Duration>, pub min_cycle: Option<Duration>, pub driver: Option<String>, pub flags: DeviceFlags, pub hex_data: Option<String>, pub native: Option<u8>, pub parity: Option<String>, pub path: Option<String>, pub readonly: bool, pub serial_number: Option<String>, pub stopbits: Option<u8>, pub subtype: Option<String>, pub subtype1: Option<String>,
}
Expand description

Device object.

Fields§

§activated: Option<DateTime<Utc>>

Time the device was activated as an ISO8601 time stamp.

If the device is inactive this attribute is absent.

§bps: Option<u32>

Device speed in bits per second.

§cycle: Option<Duration>

Device cycle time in seconds.

§min_cycle: Option<Duration>

Device minimum cycle time in seconds.

Reported from ?DEVICE when (and only when) the rate is switchable. It is read-only and not settable.

§driver: Option<String>

GPSD’s name for the device driver type.

Won’t be reported before gpsd has seen identifiable packets from the device.

§flags: DeviceFlags

Bit vector of property flags.

Currently defined flags are: describe packet types seen so far (GPS, RTCM2, RTCM3, AIS). Won’t be reported if empty, e.g. before gpsd has seen identifiable packets from the device.

§hex_data: Option<String>

Data, in bare hexadecimal, to send to the GNSS receiver.

§native: Option<u8>

0 means NMEA mode and 1 means alternate mode (binary if it has one, for SiRF and Evermore chipsets in particular).

Attempting to set this mode on a non-GPS device will yield an error.

§parity: Option<String>

N, O or E for no parity, odd, or even.

§path: Option<String>

Name the device for which the control bits are being reported, or for which they are to be applied.

This attribute may be omitted only when there is exactly one subscribed channel.

§readonly: bool

True if device is read-only.

§serial_number: Option<String>

Hardware serial number (if the device driver returns that value).

§stopbits: Option<u8>

Stop bits (1 or 2).

§subtype: Option<String>

Whatever version information the device driver returned.

§subtype1: Option<String>

More version information the device driver returned.

Trait Implementations§

§

impl Clone for Device

§

fn clone(&self) -> Device

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
§

impl Debug for Device

§

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

Formats the value using the given formatter. Read more
§

impl Default for Device

§

fn default() -> Device

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

impl<'de> Deserialize<'de> for Device

§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl From<NmeaFrame> for Device

§

fn from(frame: NmeaFrame) -> Self

Converts to this type from the input type.
§

impl Serialize for Device

§

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§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.