Enum rbx_types::Variant

source ·
#[non_exhaustive]
pub enum Variant {
Show 38 variants Axes(Axes), BinaryString(BinaryString), Bool(bool), BrickColor(BrickColor), CFrame(CFrame), Color3(Color3), Color3uint8(Color3uint8), ColorSequence(ColorSequence), Content(Content), Enum(Enum), Faces(Faces), Float32(f32), Float64(f64), Int32(i32), Int64(i64), NumberRange(NumberRange), NumberSequence(NumberSequence), PhysicalProperties(PhysicalProperties), Ray(Ray), Rect(Rect), Ref(Ref), Region3(Region3), Region3int16(Region3int16), SharedString(SharedString), String(String), UDim(UDim), UDim2(UDim2), Vector2(Vector2), Vector2int16(Vector2int16), Vector3(Vector3), Vector3int16(Vector3int16), OptionalCFrame(Option<CFrame>), Tags(Tags), Attributes(Attributes), Font(Font), UniqueId(UniqueId), MaterialColors(MaterialColors), SecurityCapabilities(SecurityCapabilities),
}
Expand description

Represents any Roblox type. Useful for operating generically on Roblox instances.

Stability

New variants may be added to Variant in minor releases. As such, it is marked #[non_exhaustive].

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Axes(Axes)

§

BinaryString(BinaryString)

§

Bool(bool)

§

BrickColor(BrickColor)

§

CFrame(CFrame)

§

Color3(Color3)

§

Color3uint8(Color3uint8)

§

ColorSequence(ColorSequence)

§

Content(Content)

§

Enum(Enum)

§

Faces(Faces)

§

Float32(f32)

§

Float64(f64)

§

Int32(i32)

§

Int64(i64)

§

NumberRange(NumberRange)

§

NumberSequence(NumberSequence)

§

PhysicalProperties(PhysicalProperties)

§

Ray(Ray)

§

Rect(Rect)

§

Ref(Ref)

§

Region3(Region3)

§

Region3int16(Region3int16)

§

SharedString(SharedString)

§

String(String)

§

UDim(UDim)

§

UDim2(UDim2)

§

Vector2(Vector2)

§

Vector2int16(Vector2int16)

§

Vector3(Vector3)

§

Vector3int16(Vector3int16)

§

OptionalCFrame(Option<CFrame>)

§

Tags(Tags)

§

Attributes(Attributes)

§

Font(Font)

§

UniqueId(UniqueId)

§

MaterialColors(MaterialColors)

§

SecurityCapabilities(SecurityCapabilities)

Implementations§

source§

impl Variant

source

pub fn ty(&self) -> VariantType

Trait Implementations§

source§

impl Clone for Variant

source§

fn clone(&self) -> Variant

Returns a copy 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 Variant

source§

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

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

impl From<&str> for Variant

source§

fn from(value: &str) -> Self

Converts to this type from the input type.
source§

impl From<Attributes> for Variant

source§

fn from(value: Attributes) -> Self

Converts to this type from the input type.
source§

impl From<Axes> for Variant

source§

fn from(value: Axes) -> Self

Converts to this type from the input type.
source§

impl From<BinaryString> for Variant

source§

fn from(value: BinaryString) -> Self

Converts to this type from the input type.
source§

impl From<BrickColor> for Variant

source§

fn from(value: BrickColor) -> Self

Converts to this type from the input type.
source§

impl From<CFrame> for Variant

source§

fn from(value: CFrame) -> Self

Converts to this type from the input type.
source§

impl From<Color3> for Variant

source§

fn from(value: Color3) -> Self

Converts to this type from the input type.
source§

impl From<Color3uint8> for Variant

source§

fn from(value: Color3uint8) -> Self

Converts to this type from the input type.
source§

impl From<ColorSequence> for Variant

source§

fn from(value: ColorSequence) -> Self

Converts to this type from the input type.
source§

impl From<Content> for Variant

source§

fn from(value: Content) -> Self

Converts to this type from the input type.
source§

impl From<Enum> for Variant

source§

fn from(value: Enum) -> Self

Converts to this type from the input type.
source§

impl From<Faces> for Variant

source§

fn from(value: Faces) -> Self

Converts to this type from the input type.
source§

impl From<Font> for Variant

source§

fn from(value: Font) -> Self

Converts to this type from the input type.
source§

impl From<MaterialColors> for Variant

source§

fn from(value: MaterialColors) -> Self

Converts to this type from the input type.
source§

impl From<NumberRange> for Variant

source§

fn from(value: NumberRange) -> Self

Converts to this type from the input type.
source§

impl From<NumberSequence> for Variant

source§

fn from(value: NumberSequence) -> Self

Converts to this type from the input type.
source§

impl From<Option<CFrame>> for Variant

source§

fn from(value: Option<CFrame>) -> Self

Converts to this type from the input type.
source§

impl From<PhysicalProperties> for Variant

source§

fn from(value: PhysicalProperties) -> Self

Converts to this type from the input type.
source§

impl From<Ray> for Variant

source§

fn from(value: Ray) -> Self

Converts to this type from the input type.
source§

impl From<Rect> for Variant

source§

fn from(value: Rect) -> Self

Converts to this type from the input type.
source§

impl From<Ref> for Variant

source§

fn from(value: Ref) -> Self

Converts to this type from the input type.
source§

impl From<Region3> for Variant

source§

fn from(value: Region3) -> Self

Converts to this type from the input type.
source§

impl From<Region3int16> for Variant

source§

fn from(value: Region3int16) -> Self

Converts to this type from the input type.
source§

impl From<SecurityCapabilities> for Variant

source§

fn from(value: SecurityCapabilities) -> Self

Converts to this type from the input type.
source§

impl From<SharedString> for Variant

source§

fn from(value: SharedString) -> Self

Converts to this type from the input type.
source§

impl From<String> for Variant

source§

fn from(value: String) -> Self

Converts to this type from the input type.
source§

impl From<Tags> for Variant

source§

fn from(value: Tags) -> Self

Converts to this type from the input type.
source§

impl From<UDim> for Variant

source§

fn from(value: UDim) -> Self

Converts to this type from the input type.
source§

impl From<UDim2> for Variant

source§

fn from(value: UDim2) -> Self

Converts to this type from the input type.
source§

impl From<UniqueId> for Variant

source§

fn from(value: UniqueId) -> Self

Converts to this type from the input type.
source§

impl From<Vector2> for Variant

source§

fn from(value: Vector2) -> Self

Converts to this type from the input type.
source§

impl From<Vector2int16> for Variant

source§

fn from(value: Vector2int16) -> Self

Converts to this type from the input type.
source§

impl From<Vector3> for Variant

source§

fn from(value: Vector3) -> Self

Converts to this type from the input type.
source§

impl From<Vector3int16> for Variant

source§

fn from(value: Vector3int16) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Variant

source§

fn from(value: bool) -> Self

Converts to this type from the input type.
source§

impl From<f32> for Variant

source§

fn from(value: f32) -> Self

Converts to this type from the input type.
source§

impl From<f64> for Variant

source§

fn from(value: f64) -> Self

Converts to this type from the input type.
source§

impl From<i32> for Variant

source§

fn from(value: i32) -> Self

Converts to this type from the input type.
source§

impl From<i64> for Variant

source§

fn from(value: i64) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Variant

source§

fn eq(&self, other: &Variant) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Variant

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

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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

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

§

fn vzip(self) -> V