Skip to main content

WrappedIOData

Enum WrappedIOData 

Source
pub enum WrappedIOData {
Show 14 variants Boolean(bool), Percentage(Percentage), Percentage_2D(Percentage2D), Percentage_3D(Percentage3D), Percentage_4D(Percentage4D), SignedPercentage(SignedPercentage), SignedPercentage_2D(SignedPercentage2D), SignedPercentage_3D(SignedPercentage3D), SignedPercentage_4D(SignedPercentage4D), ImageFrame(ImageFrame), SegmentedImageFrame(SegmentedImageFrame), MiscData(MiscData), GazeProperties(GazeProperties), ImageFilteringSettings(ImageFilteringSettings),
}
Expand description

Type-safe wrapper for heterogeneous I/O data.

Enables storing different types of sensor/motor data in a single enum, supporting dynamic dispatch while maintaining type safety through pattern matching.

Provides conversions from/to concrete types via From/TryFrom traits.

§Examples

use feagi_sensorimotor::wrapped_io_data::WrappedIOData;
use feagi_sensorimotor::data_types::Percentage;

let percentage = Percentage::new_from_0_1(0.75).unwrap();
let wrapped: WrappedIOData = percentage.into();

// Extract back to concrete type
let extracted: Percentage = wrapped.try_into().unwrap();

Due to Rust’s memory management, WrappedIOData is used to pass around various data structures around.

Variants§

§

Boolean(bool)

§

Percentage(Percentage)

§

Percentage_2D(Percentage2D)

§

Percentage_3D(Percentage3D)

§

Percentage_4D(Percentage4D)

§

SignedPercentage(SignedPercentage)

§

SignedPercentage_2D(SignedPercentage2D)

§

SignedPercentage_3D(SignedPercentage3D)

§

SignedPercentage_4D(SignedPercentage4D)

§

ImageFrame(ImageFrame)

§

SegmentedImageFrame(SegmentedImageFrame)

§

MiscData(MiscData)

§

GazeProperties(GazeProperties)

§

ImageFilteringSettings(ImageFilteringSettings)

Trait Implementations§

Source§

impl Clone for WrappedIOData

Source§

fn clone(&self) -> WrappedIOData

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 WrappedIOData

Source§

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

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

impl Display for WrappedIOData

Source§

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

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

impl From<&WrappedIOData> for WrappedIOType

Source§

fn from(io_type: &WrappedIOData) -> WrappedIOType

Converts to this type from the input type.
Source§

impl From<GazeProperties> for WrappedIOData

Source§

fn from(value: GazeProperties) -> WrappedIOData

Converts to this type from the input type.
Source§

impl From<ImageFilteringSettings> for WrappedIOData

Source§

fn from(value: ImageFilteringSettings) -> WrappedIOData

Converts to this type from the input type.
Source§

impl From<ImageFrame> for WrappedIOData

Source§

fn from(value: ImageFrame) -> WrappedIOData

Converts to this type from the input type.
Source§

impl From<MiscData> for WrappedIOData

Source§

fn from(value: MiscData) -> WrappedIOData

Converts to this type from the input type.
Source§

impl From<Percentage> for WrappedIOData

Source§

fn from(value: Percentage) -> WrappedIOData

Converts to this type from the input type.
Source§

impl From<Percentage2D> for WrappedIOData

Source§

fn from(value: Percentage2D) -> WrappedIOData

Converts to this type from the input type.
Source§

impl From<Percentage3D> for WrappedIOData

Source§

fn from(value: Percentage3D) -> WrappedIOData

Converts to this type from the input type.
Source§

impl From<Percentage4D> for WrappedIOData

Source§

fn from(value: Percentage4D) -> WrappedIOData

Converts to this type from the input type.
Source§

impl From<SegmentedImageFrame> for WrappedIOData

Source§

fn from(value: SegmentedImageFrame) -> WrappedIOData

Converts to this type from the input type.
Source§

impl From<SignedPercentage> for WrappedIOData

Source§

fn from(value: SignedPercentage) -> WrappedIOData

Converts to this type from the input type.
Source§

impl From<SignedPercentage2D> for WrappedIOData

Source§

fn from(value: SignedPercentage2D) -> WrappedIOData

Converts to this type from the input type.
Source§

impl From<SignedPercentage3D> for WrappedIOData

Source§

fn from(value: SignedPercentage3D) -> WrappedIOData

Converts to this type from the input type.
Source§

impl From<SignedPercentage4D> for WrappedIOData

Source§

fn from(value: SignedPercentage4D) -> WrappedIOData

Converts to this type from the input type.
Source§

impl From<WrappedIOData> for WrappedIOType

Source§

fn from(io_type: WrappedIOData) -> WrappedIOType

Converts to this type from the input type.
Source§

impl From<bool> for WrappedIOData

Source§

fn from(value: bool) -> WrappedIOData

Converts to this type from the input type.
Source§

impl<'a> TryFrom<&'a WrappedIOData> for &'a GazeProperties

Source§

type Error = FeagiDataError

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

fn try_from( value: &'a WrappedIOData, ) -> Result<&'a GazeProperties, <&'a GazeProperties as TryFrom<&'a WrappedIOData>>::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a WrappedIOData> for &'a ImageFrame

Source§

type Error = FeagiDataError

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

fn try_from( value: &'a WrappedIOData, ) -> Result<&'a ImageFrame, <&'a ImageFrame as TryFrom<&'a WrappedIOData>>::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a WrappedIOData> for &'a MiscData

Source§

type Error = FeagiDataError

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

fn try_from( value: &'a WrappedIOData, ) -> Result<&'a MiscData, <&'a MiscData as TryFrom<&'a WrappedIOData>>::Error>

Performs the conversion.
Source§

impl TryFrom<&WrappedIOData> for GazeProperties

Source§

type Error = FeagiDataError

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

fn try_from( value: &WrappedIOData, ) -> Result<GazeProperties, <GazeProperties as TryFrom<&WrappedIOData>>::Error>

Performs the conversion.
Source§

impl TryFrom<&WrappedIOData> for ImageFrame

Source§

type Error = FeagiDataError

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

fn try_from( value: &WrappedIOData, ) -> Result<ImageFrame, <ImageFrame as TryFrom<&WrappedIOData>>::Error>

Performs the conversion.
Source§

impl TryFrom<&WrappedIOData> for MiscData

Source§

type Error = FeagiDataError

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

fn try_from( value: &WrappedIOData, ) -> Result<MiscData, <MiscData as TryFrom<&WrappedIOData>>::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut WrappedIOData> for &'a mut GazeProperties

Source§

type Error = FeagiDataError

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

fn try_from( value: &'a mut WrappedIOData, ) -> Result<&'a mut GazeProperties, <&'a mut GazeProperties as TryFrom<&'a mut WrappedIOData>>::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut WrappedIOData> for &'a mut ImageFrame

Source§

type Error = FeagiDataError

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

fn try_from( value: &'a mut WrappedIOData, ) -> Result<&'a mut ImageFrame, <&'a mut ImageFrame as TryFrom<&'a mut WrappedIOData>>::Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a mut WrappedIOData> for &'a mut MiscData

Source§

type Error = FeagiDataError

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

fn try_from( value: &'a mut WrappedIOData, ) -> Result<&'a mut MiscData, <&'a mut MiscData as TryFrom<&'a mut WrappedIOData>>::Error>

Performs the conversion.
Source§

impl TryFrom<WrappedIOData> for GazeProperties

Source§

type Error = FeagiDataError

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

fn try_from( value: WrappedIOData, ) -> Result<GazeProperties, <GazeProperties as TryFrom<WrappedIOData>>::Error>

Performs the conversion.
Source§

impl TryFrom<WrappedIOData> for ImageFrame

Source§

type Error = FeagiDataError

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

fn try_from( value: WrappedIOData, ) -> Result<ImageFrame, <ImageFrame as TryFrom<WrappedIOData>>::Error>

Performs the conversion.
Source§

impl TryFrom<WrappedIOData> for MiscData

Source§

type Error = FeagiDataError

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

fn try_from( value: WrappedIOData, ) -> Result<MiscData, <MiscData as TryFrom<WrappedIOData>>::Error>

Performs the conversion.

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more