pub enum Data {
Show 16 variants
Boolean(Boolean),
Integer(Integer),
Real(Real),
String(String),
Color(Color),
Vector2(Vector2),
Matrix3(Matrix3),
BooleanVec(BooleanVec),
IntegerVec(IntegerVec),
RealVec(RealVec),
ColorVec(ColorVec),
StringVec(StringVec),
Vector2Vec(Vector2Vec),
Matrix3Vec(Matrix3Vec),
RealCurve(RealCurve),
ColorCurve(ColorCurve),
}Expand description
A variant enum containing all supported data types.
Data can hold scalar values (Boolean, Integer, Real,
String), vector types (Vector2, [Vector3], Color,
Matrix3), and collections of these types (BooleanVec,
IntegerVec, etc.).
Variants§
Boolean(Boolean)
A boolean value.
Integer(Integer)
A 64-bit signed integer.
Real(Real)
A 64-bit floating-point number.
String(String)
A UTF-8 string.
Color(Color)
A 4-component RGBA color.
Vector2(Vector2)
A 2D vector.
Matrix3(Matrix3)
A 3×3 transformation matrix.
BooleanVec(BooleanVec)
A vector of boolean values.
IntegerVec(IntegerVec)
A vector of integer values.
RealVec(RealVec)
A vector of real values.
ColorVec(ColorVec)
A vector of color values.
StringVec(StringVec)
A vector of string values.
Vector2Vec(Vector2Vec)
A vector of 2D vectors.
Matrix3Vec(Matrix3Vec)
A vector of matrices.
RealCurve(RealCurve)
A real-valued curve (Position → Real).
ColorCurve(ColorCurve)
A color-valued curve (Position → Color).
Implementations§
Source§impl Data
impl Data
Sourcepub fn try_len(&self) -> Option<usize>
pub fn try_len(&self) -> Option<usize>
Get the length of a vector value, or None for scalar values
pub fn to_bool(&self) -> Result<bool>
pub fn to_f32(&self) -> Result<f32>
pub fn to_f64(&self) -> Result<f64>
pub fn to_i32(&self) -> Result<i32>
pub fn to_i64(&self) -> Result<i64>
pub fn as_slice_f64(&self) -> Result<&[f64]>
pub fn as_slice_f32(&self) -> Result<&[f32]>
pub fn as_slice_i64(&self) -> Result<&[i64]>
pub fn as_vector2_ref(&self) -> Result<&[f32; 2]>
pub fn as_vector3_ref(&self) -> Result<&[f32; 3]>
pub fn as_matrix3_ref(&self) -> Result<&[f32; 9]>
pub fn as_color_ref(&self) -> Result<&[f32; 4]>
pub fn as_str(&self) -> Result<&str>
pub fn as_slice_string(&self) -> Result<&[String]>
Trait Implementations§
Source§impl DataSystem for Data
impl DataSystem for Data
Source§type Animated = AnimatedData
type Animated = AnimatedData
The animated data container type for this system.
Source§fn discriminant(&self) -> DataType
fn discriminant(&self) -> DataType
Returns the discriminant for this value. Read more
Source§fn variant_name(&self) -> &'static str
fn variant_name(&self) -> &'static str
Returns a human-readable type name for this value. Read more
Source§fn try_len(&self) -> Option<usize>
fn try_len(&self) -> Option<usize>
Returns the length if this is a vector type,
None for scalars. Read moreSource§fn pad_to_length(&mut self, target_len: usize)
fn pad_to_length(&mut self, target_len: usize)
Pads a vector value to the target length. Read more
Source§impl DataTypeOps for Data
impl DataTypeOps for Data
Source§impl IntoDiscriminant for Data
impl IntoDiscriminant for Data
Source§type Discriminant = DataType
type Discriminant = DataType
Enum listing the same variants as this enum but without any data fields
fn discriminant(&self) -> Self::Discriminant
impl Eq for Data
impl StructuralPartialEq for Data
Auto Trait Implementations§
impl Freeze for Data
impl RefUnwindSafe for Data
impl Send for Data
impl Sync for Data
impl Unpin for Data
impl UnsafeUnpin for Data
impl UnwindSafe for Data
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> 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 more