Struct visa_api::Instrument

source ·
pub struct Instrument {
    pub idn: Idn,
    pub session: Instrument,
    pub address: VisaString,
}
Expand description

Instrument struct that holds the IDN data, the session and the instrument adress

Fields§

§idn: Idn§session: Instrument§address: VisaString

Implementations§

source§

impl Instrument

source

pub fn new(idn: Idn, session: Instrument, address: VisaString) -> Instrument

Create a new Instrument object

source

pub fn write(&mut self, command: &str) -> Result<()>

Raw write to a VISA device

source

pub fn read(&self) -> Result<String>

Raw read to a VISA device

source

pub fn private_read(session: &Instrument) -> Result<String>

source

pub fn query_idn(&mut self) -> Result<Idn>

Query the device for Identify data, returns the Idn struct

source

pub fn get_instrument( resource_manager: &DefaultRM, manufacturer: &str, model: &str ) -> Result<Option<Instrument>>

Query for a devide with a specific manufacturer and model, returns the VISA API Instrument struct

source

pub fn get_addresses(resource_manager: &DefaultRM) -> Result<Vec<VisaString>>

Query for all instruments connected, returns a list of addresses

source

pub fn reset(&mut self) -> Result<()>

Trait Implementations§

source§

impl Debug for Instrument

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.