Skip to main content

instrument_core/
lib.rs

1//! VISA-agnostic instrument control: transport, SCPI, discovery, and mock fixtures.
2//!
3//! This crate has no VISA dependency. Use [`Transport`] for byte I/O,
4//! [`ScpiSession`] for SCPI framing, and [`ScriptedFixture`] for CI mocks.
5//!
6//! Enable the `async` feature for `AsyncTransport` and `AsyncScpiSession`
7//! with the same framing and retry semantics as the sync path.
8//!
9//! For the full discovery and typed-class API, use the `instrument-components` facade.
10
11pub mod address;
12#[cfg(feature = "async")]
13pub mod async_session;
14#[cfg(feature = "async")]
15pub mod async_transport;
16pub mod classifier;
17pub mod connect;
18pub mod diagnostics;
19pub mod dialect;
20pub mod enumerator;
21pub mod error;
22pub mod identity;
23pub mod ieee4882;
24pub mod kind;
25pub mod mock;
26pub mod probe_policy;
27pub mod registry;
28pub mod scpi;
29pub mod scpi_commands;
30pub mod session;
31pub mod transport;
32
33#[cfg(feature = "record")]
34pub mod recording;
35
36pub use address::{AddressParts, InterfaceKind, ResourceAddress};
37#[cfg(feature = "async")]
38pub use async_session::{
39    AsyncInstrumentSession, AsyncPooledSession, AsyncSessionOpener, AsyncSessionPool,
40};
41#[cfg(feature = "async")]
42pub use async_transport::{AsyncTransport, DynAsyncTransport, SyncAsAsyncTransport};
43pub use classifier::{
44    classify_deep, classify_from_address, classify_from_identity, classify_with_policy,
45    ClassifiedKind, ClassifySource, DiscoveredDevice,
46};
47#[cfg(feature = "async")]
48pub use classifier::{classify_deep_async, classify_with_policy_async};
49pub use connect::{AccessMode, ConnectOptions};
50pub use diagnostics::{CommsEvent, CommsEventKind, CommsObserver, DeviceHealth, Diagnostics};
51pub use dialect::{resolve_dialect, DialectProfile, DIALECT_PROFILES};
52pub use enumerator::{RawResource, ResourceEnumerator, StaticEnumerator};
53pub use error::{Error, Result, TransportError};
54pub use identity::{DeviceId, DeviceIdentity, Idn};
55#[cfg(feature = "async")]
56pub use ieee4882::AsyncIeee4882;
57pub use ieee4882::Ieee4882;
58pub use kind::InstrumentKind;
59pub use mock::{MockTransport, ScriptStep, ScriptedFixture, Transcript};
60pub use probe_policy::ProbePolicy;
61pub use registry::ModelRegistry;
62#[cfg(feature = "async")]
63pub use scpi::AsyncScpiSession;
64pub use scpi::{
65    is_opc_supported_reply, is_syst_err_supported_reply, parse_f64, parse_f64_csv, ScpiSession,
66};
67pub use session::{InstrumentSession, SessionOpener, SessionPool};
68pub use transport::{Transport, TransportIdentity};
69
70#[cfg(feature = "record")]
71pub use recording::RecordingTransport;