Expand description
High-level instrument discovery and typed IVI-inspired classes.
§Quick start (mock, no VISA)
use instrument::prelude::*;
let fixture = ScriptedFixture::builder()
.idn("Acme", "DMM1", "SN1", "1.0")
.kinds([InstrumentKind::Dmm])
.on_query(":MEAS:VOLT:DC?", "1.0")
.build();
let catalog = DeviceCatalog::from_fixture("mock://dmm", fixture)?;§Quick start (hardware)
Requires the visa feature (enabled by default).
ⓘ
use instrument::prelude::*;
let catalog = Discovery::visa()?.scan()?;§Quick start (async mock, tokio feature)
ⓘ
use instrument::prelude::*;
#[tokio::main]
async fn main() -> Result<()> {
let fixture = ScriptedFixture::builder()
.idn("Acme", "DMM1", "SN1", "1.0")
.kinds([InstrumentKind::Dmm])
.on_query(":MEAS:VOLT:DC?", "1.0")
.build();
let catalog = AsyncDeviceCatalog::from_fixture("mock://dmm", fixture).await?;
let mut dmm = catalog.open_dmm("mock://dmm").await?;
println!("{} V", dmm.measure_voltage_dc(None).await?);
Ok(())
}See the user guide, getting started, and async guide.
Re-exports§
pub use catalog::DeviceCatalog;pub use device::DeviceRef;pub use discovery::Discovery;pub use self;
Modules§
Structs§
- Access
Mode - VISA access mode (maps to visa-rs AccessMode when using visa backend).
- Comms
Event - A single communication event for observer push and tracing.
- Connect
Options - Options when opening an instrument session.
- Device
Health - Pollable health snapshot for a device address.
- Device
Id - Stable device identity for replacement and reconnection workflows.
- Diagnostics
- Shared diagnostics context injected into SCPI sessions.
- Discovered
Device - A discovered device in the catalog.
- Idn
- Parsed
*IDN?response. - Instrument
Session - Active instrument session with SCPI and cached identity.
- Mock
Transport - Scripted request/response transport for deterministic CI.
- Resource
Address - Typed VISA resource address with canonical dedup key.
- Scpi
Session - SCPI session over a boxed transport.
- Scripted
Fixture - High-level fixture builder for common instrument patterns.
- Session
Pool - Reuses a single underlying session across typed views.
- Shared
Rm - Shared resource manager — keeps the strong RM alive while sessions exist.
- Transport
Identity - Optional pre-SCPI identity hints from the transport backend.
- Visa
Enumerator - VISA-backed resource enumerator.
- Visa
Session Opener - Opens VISA sessions for instrument-core.
Enums§
- Comms
Event Kind - Kind of communication event.
- Error
- Core error type — VISA-free; backend errors are boxed.
- Instrument
Kind - Instrument functional class (IVI-inspired).
- Probe
Policy - How aggressively discovery probes instrument capabilities.
Traits§
- Comms
Observer - Receives push notifications for instrument communication events.
- Transport
- Swappable byte-level transport for instrument I/O.