pub enum WrappedIOType {
Show 14 variants
Boolean,
Percentage,
Percentage_2D,
Percentage_3D,
Percentage_4D,
SignedPercentage,
SignedPercentage_2D,
SignedPercentage_3D,
SignedPercentage_4D,
ImageFrame(Option<ImageFrameProperties>),
SegmentedImageFrame(Option<SegmentedImageFrameProperties>),
MiscData(Option<MiscDataDimensions>),
GazeProperties,
ImageFilteringSettings,
}Expand description
Type descriptor for wrapped I/O data.
Describes the variant of data stored in a WrappedIOData enum without holding
the actual data. Used for type checking, validation, and creating appropriately-typed
blank data instances.
Some variants (images, misc data) can optionally include dimensional properties to enable efficient memory pre-allocation.
§Examples
use feagi_sensorimotor::wrapped_io_data::WrappedIOType;
let io_type = WrappedIOType::Percentage;
let blank_data = io_type.create_blank_data_of_type().unwrap();Variants§
Boolean
Percentage
Percentage_2D
Percentage_3D
Percentage_4D
SignedPercentage
SignedPercentage_2D
SignedPercentage_3D
SignedPercentage_4D
ImageFrame(Option<ImageFrameProperties>)
SegmentedImageFrame(Option<SegmentedImageFrameProperties>)
MiscData(Option<MiscDataDimensions>)
GazeProperties
ImageFilteringSettings
Implementations§
Source§impl WrappedIOType
impl WrappedIOType
Sourcepub fn is_same_variant(a: &WrappedIOType, b: &WrappedIOType) -> bool
pub fn is_same_variant(a: &WrappedIOType, b: &WrappedIOType) -> bool
Checks if two types are the same variant, ignoring associated data.
§Example
use feagi_sensorimotor::wrapped_io_data::WrappedIOType;
let a = WrappedIOType::Percentage;
let b = WrappedIOType::Percentage;
assert!(WrappedIOType::is_same_variant(&a, &b));Sourcepub fn is_of(&self, io_type: &WrappedIOData) -> bool
pub fn is_of(&self, io_type: &WrappedIOData) -> bool
Checks if actual I/O data matches this type descriptor.
Sourcepub fn create_blank_data_of_type(&self) -> Result<WrappedIOData, FeagiDataError>
pub fn create_blank_data_of_type(&self) -> Result<WrappedIOData, FeagiDataError>
Creates a zero-initialized instance of wrapped data for this type.
For types with associated properties (images, misc data), those properties must be provided or this will return an error.
Trait Implementations§
Source§impl Clone for WrappedIOType
impl Clone for WrappedIOType
Source§fn clone(&self) -> WrappedIOType
fn clone(&self) -> WrappedIOType
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 WrappedIOType
impl Debug for WrappedIOType
Source§impl<'de> Deserialize<'de> for WrappedIOType
impl<'de> Deserialize<'de> for WrappedIOType
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WrappedIOType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WrappedIOType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for WrappedIOType
impl Display for WrappedIOType
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<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 Hash for WrappedIOType
impl Hash for WrappedIOType
Source§impl PartialEq for WrappedIOType
impl PartialEq for WrappedIOType
Source§impl Serialize for WrappedIOType
impl Serialize for WrappedIOType
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for WrappedIOType
impl Eq for WrappedIOType
impl StructuralPartialEq for WrappedIOType
Auto Trait Implementations§
impl Freeze for WrappedIOType
impl RefUnwindSafe for WrappedIOType
impl Send for WrappedIOType
impl Sync for WrappedIOType
impl Unpin for WrappedIOType
impl UnwindSafe for WrappedIOType
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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.