# visa-api-rs
The `visa.h` vocabulary from VPP-4.3: the C-ABI type aliases (`ViStatus`,
`ViSession`, `ViAttr`, …) and `VI_*` constants under their `visa.h` names.
No dependencies, no behaviour and `#![no_std]`, so a crate that loads a
vendor VISA library at runtime can use it without linking any VISA
implementation.
It is part of [rsvisa-rs](https://github.com/nominal-io/rsvisa-rs), which
takes its constant values from here.
Each constant has the Rust type of the place it is used:
| Completion and error codes (`VI_SUCCESS*`, `VI_WARN_*`, `VI_ERROR_*`) | `ViStatus` |
| Attribute ids (`VI_ATTR_*`) | `ViAttr` |
| Attribute values (`VI_ASRL_*`, `VI_INTF_*`, `VI_STATE_*`, `VI_TMO_*`) | the attribute's value type (`ViUInt16`, `ViInt16`, `ViUInt32`) |
| Lock types (`VI_NO_LOCK`, `VI_EXCLUSIVE_LOCK`, `VI_SHARED_LOCK`) | `ViAccessMode` |
| `viFlush` masks (`VI_READ_BUF`, `VI_IO_IN_BUF`, …) | `ViUInt16` |
| `viAssertTrigger` protocols (`VI_TRIG_PROT_*`) | `ViUInt16` |
| `VI_TRUE`, `VI_FALSE` | `ViBoolean` |
| `VI_NULL` | `ViObject` |
| `VI_FIND_BUFLEN` | `usize` |
Widen an attribute value to `ViAttrState` with `.into()` to pass it to
`viSetAttribute`.