Skip to main content

Command

Enum Command 

pub enum Command {
    GetVersion,
    ListDevices,
    GetWatchPolicy,
    SetWatchPolicy(Watch),
    Poll,
    GetDevice,
    SetDevice(Device),
}
Expand description

Commands that can be sent to the gpsd server.

Variants§

§

GetVersion

Gets the version of the gpsd server.

The server will respond with a Version object.

§

ListDevices

Lists all devices that gpsd knows about.

The server will respond with a Devices object.

§

GetWatchPolicy

Gets the current watch policy.

The server will respond with a Watch object.

§

SetWatchPolicy(Watch)

Sets the watch policy.

The server will respond with a Devices object followed by a Watch object.

§

Poll

Requests data from the last-seen fixes on all active GPS devices.

Devices must previously have their watch policy set to enabled to be pollable.

The server will respond with a Poll object.

§

GetDevice

Reports the state of a device.

The server will respond with a Device object.

§

SetDevice(Device)

Sets device-specific control bits.

The server will respond with a Device object.

Implementations§

§

impl Command

pub fn set_watch_policy() -> SetWatchPolicyBuilder

Creates a new builder for the command.

Trait Implementations§

§

impl Debug for Command

§

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

Formats the value using the given formatter. Read more
§

impl Encoder<Command> for ObjectCodec

§

type Error = Error

The type of encoding errors. Read more
§

fn encode( &mut self, item: Command, dst: &mut BytesMut, ) -> Result<(), Self::Error>

Encodes a frame into the buffer provided. Read more
§

impl Sink<Command> for Channel

§

type Error = Error

The type of value produced by the sink when an error occurs.
§

fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Attempts to prepare the Sink to receive a value. Read more
§

fn start_send(self: Pin<&mut Self>, item: Command) -> Result<(), Self::Error>

Begin the process of sending a value to the sink. Each call to this function must be preceded by a successful call to poll_ready which returned Poll::Ready(Ok(())). Read more
§

fn poll_flush( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Flush any remaining output from this sink. Read more
§

fn poll_close( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>

Flush any remaining output and close this sink, if necessary. 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> 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 = !

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.