Crate gpsd_json
Expand description
A client for the gpsd protocol.
Right now this crate doesn’t expose a proper client API, since doing so
would require a full blown event loop implementation. Instead, it exposes
the Channel type, which can be used to interact with a gpsd server.
The main consequence of this is that the user needs to manually handle the
request-response flow.
§Example
use futures::{SinkExt, StreamExt};
use gpsd_json::{Command, Channel};
let mut channel = Channel::connect_localhost().await.unwrap();
// watch all devices
channel.send(Command::set_watch_policy().enable().json().build()).await.unwrap();
while let Some(object) = channel.next().await {
println!("{:?}", object?);
}Re-exports§
Modules§
- channel 🔒
- codec 🔒
- command
- Commands that can be sent to the gpsd server.
- error 🔒
- object
- gpsd protocol objects.
- serde 🔒
- Serde helpers.
Structs§
- Channel
- A channel to a gpsd server.
Enums§
- Error
- Errors that can occur in the gpsd codec.