GpsdJsonRequest

Trait GpsdJsonRequest 

Source
pub trait GpsdJsonRequest {
    // Required method
    fn to_command(&self) -> String;
}
Expand description

Trait for types that can be serialized as GPSD request messages

Request messages in GPSD follow a specific command format, typically starting with ‘?’ and ending with ‘;’.

Required Methods§

Source

fn to_command(&self) -> String

Converts the request into a GPSD command string

The returned string should be a valid GPSD command that can be sent directly to the server. Commands typically follow the format: ?COMMAND[=JSON_PARAMS];

§Example
fn to_command(&self) -> String {
    "?WATCH={\"enable\":true};".to_string()
}

Implementors§