ActionResult

Enum ActionResult 

Source
pub enum ActionResult {
    Value(f64),
    Values(Vec<f64>),
    Text(Vec<String>),
    Status(bool),
    Position(Position),
    OsciData(OsciData),
    Success,
    None,
}
Expand description

Simplified ActionResult with clear semantic separation

Variants§

§

Value(f64)

Single numeric value (signals, bias, etc.)

§

Values(Vec<f64>)

Multiple numeric values (signal arrays)

§

Text(Vec<String>)

String data (signal names, error messages, etc.)

§

Status(bool)

Boolean status (scanning/idle, running/stopped, etc.)

§

Position(Position)

Position data (meaningful x,y structure)

§

OsciData(OsciData)

Complex oscilloscope data (timing + data + metadata)

§

Success

Operation completed successfully (no data returned)

§

None

No result/waiting state

Implementations§

Source§

impl ActionResult

Source

pub fn as_f64(&self) -> Option<f64>

Convert to f64 if possible (for numerical results)

Source

pub fn as_bool(&self) -> Option<bool>

Convert to bool if possible (for status results)

Source

pub fn as_position(&self) -> Option<Position>

Convert to Position if possible

Source

pub fn as_osci_data(&self) -> Option<&OsciData>

Convert to OsciData if possible

Source

pub fn expect_osci_data(self, action: &Action) -> OsciData

Extract OsciData with action validation (panics on type mismatch)

Source

pub fn expect_signal_value(self, action: &Action) -> f64

Extract signal value with action validation (panics on type mismatch)

Source

pub fn expect_values(self, action: &Action) -> Vec<f64>

Extract multiple values with action validation (panics on type mismatch)

Source

pub fn expect_position(self, action: &Action) -> Position

Extract position with action validation (panics on type mismatch)

Source

pub fn expect_bias_voltage(self, action: &Action) -> f32

Extract bias voltage with action validation (panics on type mismatch)

Source

pub fn expect_signal_names(self, action: &Action) -> Vec<String>

Extract signal names with action validation (panics on type mismatch)

Source

pub fn expect_status(self, action: &Action) -> bool

Extract status with action validation (panics on type mismatch)

Source

pub fn try_into_osci_data(self, action: &Action) -> Result<OsciData, String>

Try to extract OsciData with action validation

Source

pub fn try_into_signal_value(self, action: &Action) -> Result<f64, String>

Try to extract signal value with action validation

Source

pub fn try_into_position(self, action: &Action) -> Result<Position, String>

Try to extract position with action validation

Source

pub fn try_into_status(self, action: &Action) -> Result<bool, String>

Try to extract status with action validation

Trait Implementations§

Source§

impl Clone for ActionResult

Source§

fn clone(&self) -> ActionResult

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ActionResult

Source§

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

Formats the value using the given formatter. Read more
Source§

impl ExpectFromAction<OsciData> for ActionResult

Source§

impl ExpectFromAction<Position> for ActionResult

Source§

impl ExpectFromAction<Vec<String>> for ActionResult

Source§

impl ExpectFromAction<Vec<f64>> for ActionResult

Source§

fn expect_from_action(self, action: &Action) -> Vec<f64>

Source§

impl ExpectFromAction<bool> for ActionResult

Source§

fn expect_from_action(self, action: &Action) -> bool

Source§

impl ExpectFromAction<f32> for ActionResult

Source§

fn expect_from_action(self, action: &Action) -> f32

Source§

impl ExpectFromAction<f64> for ActionResult

Source§

fn expect_from_action(self, action: &Action) -> f64

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.