pub enum Data {
Show 14 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),
}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.
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 DataTypeOps for Data
impl DataTypeOps for Data
Source§impl From<Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>> for Data
Available on crate feature vector2 only.
impl From<Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>> for Data
Available on crate feature
vector2 only.Source§impl From<Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>> for Data
Available on crate feature matrix3 only.
impl From<Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>> for Data
Available on crate feature
matrix3 only.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
Source§impl TryFrom<Vec<Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>>> for Data
Available on crate features vector2 and vec_variants only.
impl TryFrom<Vec<Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>>> for Data
Available on crate features
vector2 and vec_variants only.Source§impl TryFrom<Vec<Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>>> for Data
Available on crate features matrix3 and vec_variants only.
impl TryFrom<Vec<Matrix<f32, Const<3>, Const<3>, ArrayStorage<f32, 3, 3>>>> for Data
Available on crate features
matrix3 and vec_variants only.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 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.