libindigo-rs
Pure Rust implementation of the INDIGO protocol client.
⚠️ Important: Crate Name vs Import Name
This crate is named libindigo-rs in Cargo.toml, but you must import it as libindigo_rs (with underscore) in your code.
Rust automatically converts hyphens to underscores in crate names for imports. This is a Rust convention.
// ✅ CORRECT - use underscore
use ;
// ❌ WRONG - this will cause "unresolved module" errors
use ;
Overview
libindigo-rs provides a pure Rust implementation of the INDIGO astronomy protocol client. It supports both XML and JSON protocols and includes optional mDNS-based server discovery.
Features
- Pure Rust: No C dependencies required
- Async/await: Built on Tokio for efficient async I/O
- Protocol Support: Both XML and JSON INDIGO protocols
- Server Discovery: Optional mDNS-based server discovery
- Type-safe: Leverages Rust's type system for safety
Usage
Add this to your Cargo.toml:
[]
= "0.3.0"
For server discovery support:
[]
= { = "0.3.0", = ["discovery"] }
Examples
Basic Connection
use Client;
async
Property Streaming
The Rust client supports multiple concurrent subscribers to property updates using the multi-subscriber pattern:
use RsClientStrategy;
use ClientStrategy;
async
Multiple Subscribers: You can create multiple subscribers that all receive property updates independently:
// Create multiple subscribers
let mut subscriber1 = strategy.subscribe_properties.await;
let mut subscriber2 = strategy.subscribe_properties.await;
// Each subscriber receives all property updates
spawn;
spawn;
Note: The old property_receiver() method is deprecated. Use subscribe_properties() instead for proper multi-subscriber support.
For a complete example, see examples/property_streaming.rs.
Features
client(default): Enable client functionalitydevice: Stub for future device driver supportdiscovery: Enable mDNS server discovery
Troubleshooting
"unresolved module or unlinked crate libindigo" Error
If you see this error:
error[E0432]: unresolved import `libindigo`
Solution: Change your import from libindigo:: to libindigo_rs:: (with underscore).
Why? Rust converts hyphens in crate names to underscores for imports. The crate is named libindigo-rs in Cargo.toml, but must be imported as libindigo_rs in code.
// Change this:
use ;
// To this:
use ;
For more troubleshooting help and migration guides, see TROUBLESHOOTING.md.
License
MIT