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
impl Clone for WrappedIOData
Source§fn clone(&self) -> WrappedIOData
fn clone(&self) -> WrappedIOData
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WrappedIOData
impl Debug for WrappedIOData
Source§impl Display for WrappedIOData
impl Display for WrappedIOData
Source§impl From<&WrappedIOData> for WrappedIOType
impl From<&WrappedIOData> for WrappedIOType
Source§fn from(io_type: &WrappedIOData) -> WrappedIOType
fn from(io_type: &WrappedIOData) -> WrappedIOType
Converts to this type from the input type.
Source§impl From<GazeProperties> for WrappedIOData
impl From<GazeProperties> for WrappedIOData
Source§fn from(value: GazeProperties) -> WrappedIOData
fn from(value: GazeProperties) -> WrappedIOData
Converts to this type from the input type.
Source§impl From<ImageFilteringSettings> for WrappedIOData
impl From<ImageFilteringSettings> for WrappedIOData
Source§fn from(value: ImageFilteringSettings) -> WrappedIOData
fn from(value: ImageFilteringSettings) -> WrappedIOData
Converts to this type from the input type.
Source§impl From<ImageFrame> for WrappedIOData
impl From<ImageFrame> for WrappedIOData
Source§fn from(value: ImageFrame) -> WrappedIOData
fn from(value: ImageFrame) -> WrappedIOData
Converts to this type from the input type.
Source§impl From<MiscData> for WrappedIOData
impl From<MiscData> for WrappedIOData
Source§fn from(value: MiscData) -> WrappedIOData
fn from(value: MiscData) -> WrappedIOData
Converts to this type from the input type.
Source§impl From<Percentage> for WrappedIOData
impl From<Percentage> for WrappedIOData
Source§fn from(value: Percentage) -> WrappedIOData
fn from(value: Percentage) -> WrappedIOData
Converts to this type from the input type.
Source§impl From<Percentage2D> for WrappedIOData
impl From<Percentage2D> for WrappedIOData
Source§fn from(value: Percentage2D) -> WrappedIOData
fn from(value: Percentage2D) -> WrappedIOData
Converts to this type from the input type.
Source§impl From<Percentage3D> for WrappedIOData
impl From<Percentage3D> for WrappedIOData
Source§fn from(value: Percentage3D) -> WrappedIOData
fn from(value: Percentage3D) -> WrappedIOData
Converts to this type from the input type.
Source§impl From<Percentage4D> for WrappedIOData
impl From<Percentage4D> for WrappedIOData
Source§fn from(value: Percentage4D) -> WrappedIOData
fn from(value: Percentage4D) -> WrappedIOData
Converts to this type from the input type.
Source§impl From<SegmentedImageFrame> for WrappedIOData
impl From<SegmentedImageFrame> for WrappedIOData
Source§fn from(value: SegmentedImageFrame) -> WrappedIOData
fn from(value: SegmentedImageFrame) -> WrappedIOData
Converts to this type from the input type.
Source§impl From<SignedPercentage> for WrappedIOData
impl From<SignedPercentage> for WrappedIOData
Source§fn from(value: SignedPercentage) -> WrappedIOData
fn from(value: SignedPercentage) -> WrappedIOData
Converts to this type from the input type.
Source§impl From<SignedPercentage2D> for WrappedIOData
impl From<SignedPercentage2D> for WrappedIOData
Source§fn from(value: SignedPercentage2D) -> WrappedIOData
fn from(value: SignedPercentage2D) -> WrappedIOData
Converts to this type from the input type.
Source§impl From<SignedPercentage3D> for WrappedIOData
impl From<SignedPercentage3D> for WrappedIOData
Source§fn from(value: SignedPercentage3D) -> WrappedIOData
fn from(value: SignedPercentage3D) -> WrappedIOData
Converts to this type from the input type.
Source§impl From<SignedPercentage4D> for WrappedIOData
impl From<SignedPercentage4D> for WrappedIOData
Source§fn from(value: SignedPercentage4D) -> WrappedIOData
fn from(value: SignedPercentage4D) -> WrappedIOData
Converts to this type from the input type.
Source§impl From<WrappedIOData> for WrappedIOType
impl From<WrappedIOData> for WrappedIOType
Source§fn from(io_type: WrappedIOData) -> WrappedIOType
fn from(io_type: WrappedIOData) -> WrappedIOType
Converts to this type from the input type.
Source§impl From<bool> for WrappedIOData
impl From<bool> for WrappedIOData
Source§fn from(value: bool) -> WrappedIOData
fn from(value: bool) -> WrappedIOData
Converts to this type from the input type.
Source§impl<'a> TryFrom<&'a WrappedIOData> for &'a GazeProperties
impl<'a> TryFrom<&'a WrappedIOData> for &'a GazeProperties
Source§type Error = FeagiDataError
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>
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
impl<'a> TryFrom<&'a WrappedIOData> for &'a ImageFrame
Source§type Error = FeagiDataError
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>
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
impl<'a> TryFrom<&'a WrappedIOData> for &'a MiscData
Source§type Error = FeagiDataError
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>
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
impl TryFrom<&WrappedIOData> for GazeProperties
Source§type Error = FeagiDataError
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>
fn try_from( value: &WrappedIOData, ) -> Result<GazeProperties, <GazeProperties as TryFrom<&WrappedIOData>>::Error>
Performs the conversion.
Source§impl TryFrom<&WrappedIOData> for ImageFrame
impl TryFrom<&WrappedIOData> for ImageFrame
Source§type Error = FeagiDataError
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>
fn try_from( value: &WrappedIOData, ) -> Result<ImageFrame, <ImageFrame as TryFrom<&WrappedIOData>>::Error>
Performs the conversion.
Source§impl TryFrom<&WrappedIOData> for MiscData
impl TryFrom<&WrappedIOData> for MiscData
Source§type Error = FeagiDataError
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>
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
impl<'a> TryFrom<&'a mut WrappedIOData> for &'a mut GazeProperties
Source§type Error = FeagiDataError
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>
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
impl<'a> TryFrom<&'a mut WrappedIOData> for &'a mut ImageFrame
Source§type Error = FeagiDataError
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>
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
impl<'a> TryFrom<&'a mut WrappedIOData> for &'a mut MiscData
Source§type Error = FeagiDataError
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>
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
impl TryFrom<WrappedIOData> for GazeProperties
Source§type Error = FeagiDataError
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>
fn try_from( value: WrappedIOData, ) -> Result<GazeProperties, <GazeProperties as TryFrom<WrappedIOData>>::Error>
Performs the conversion.
Source§impl TryFrom<WrappedIOData> for ImageFrame
impl TryFrom<WrappedIOData> for ImageFrame
Source§type Error = FeagiDataError
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>
fn try_from( value: WrappedIOData, ) -> Result<ImageFrame, <ImageFrame as TryFrom<WrappedIOData>>::Error>
Performs the conversion.
Source§impl TryFrom<WrappedIOData> for MiscData
impl TryFrom<WrappedIOData> for MiscData
Source§type Error = FeagiDataError
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>
fn try_from( value: WrappedIOData, ) -> Result<MiscData, <MiscData as TryFrom<WrappedIOData>>::Error>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for WrappedIOData
impl RefUnwindSafe for WrappedIOData
impl Send for WrappedIOData
impl Sync for WrappedIOData
impl Unpin for WrappedIOData
impl UnwindSafe for WrappedIOData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.