Enum bevy_internal::render::color::Color
source · pub enum Color {
Rgba {
red: f32,
green: f32,
blue: f32,
alpha: f32,
},
RgbaLinear {
red: f32,
green: f32,
blue: f32,
alpha: f32,
},
Hsla {
hue: f32,
saturation: f32,
lightness: f32,
alpha: f32,
},
Lcha {
lightness: f32,
chroma: f32,
hue: f32,
alpha: f32,
},
}
Variants§
Rgba
Fields
sRGBA color
RgbaLinear
Fields
RGBA color in the Linear sRGB colorspace (often colloquially referred to as “linear”, “RGB”, or “linear RGB”).
Hsla
Fields
HSL (hue, saturation, lightness) color with an alpha channel
Lcha
Fields
LCH(ab) (lightness, chroma, hue) color with an alpha channel
Implementations§
source§impl Color
impl Color
sourcepub const ALICE_BLUE: Color = _
pub const ALICE_BLUE: Color = _
sourcepub const ANTIQUE_WHITE: Color = _
pub const ANTIQUE_WHITE: Color = _
sourcepub const AQUAMARINE: Color = _
pub const AQUAMARINE: Color = _
sourcepub const DARK_GREEN: Color = _
pub const DARK_GREEN: Color = _
sourcepub const LIME_GREEN: Color = _
pub const LIME_GREEN: Color = _
sourcepub const MIDNIGHT_BLUE: Color = _
pub const MIDNIGHT_BLUE: Color = _
sourcepub const ORANGE_RED: Color = _
pub const ORANGE_RED: Color = _
sourcepub const YELLOW_GREEN: Color = _
pub const YELLOW_GREEN: Color = _
sourcepub const fn rgb(r: f32, g: f32, b: f32) -> Color
pub const fn rgb(r: f32, g: f32, b: f32) -> Color
New Color
from sRGB colorspace.
Arguments
r
- Red channel. [0.0, 1.0]g
- Green channel. [0.0, 1.0]b
- Blue channel. [0.0, 1.0]
See also Color::rgba
, Color::rgb_u8
, Color::hex
.
sourcepub const fn rgba(r: f32, g: f32, b: f32, a: f32) -> Color
pub const fn rgba(r: f32, g: f32, b: f32, a: f32) -> Color
New Color
from sRGB colorspace.
Arguments
r
- Red channel. [0.0, 1.0]g
- Green channel. [0.0, 1.0]b
- Blue channel. [0.0, 1.0]a
- Alpha channel. [0.0, 1.0]
See also Color::rgb
, Color::rgba_u8
, Color::hex
.
sourcepub const fn rgb_linear(r: f32, g: f32, b: f32) -> Color
pub const fn rgb_linear(r: f32, g: f32, b: f32) -> Color
New Color
from linear RGB colorspace.
Arguments
r
- Red channel. [0.0, 1.0]g
- Green channel. [0.0, 1.0]b
- Blue channel. [0.0, 1.0]
See also Color::rgb
, Color::rgba_linear
.
sourcepub const fn rgba_linear(r: f32, g: f32, b: f32, a: f32) -> Color
pub const fn rgba_linear(r: f32, g: f32, b: f32, a: f32) -> Color
New Color
from linear RGB colorspace.
Arguments
r
- Red channel. [0.0, 1.0]g
- Green channel. [0.0, 1.0]b
- Blue channel. [0.0, 1.0]a
- Alpha channel. [0.0, 1.0]
See also Color::rgba
, Color::rgb_linear
.
sourcepub const fn hsl(hue: f32, saturation: f32, lightness: f32) -> Color
pub const fn hsl(hue: f32, saturation: f32, lightness: f32) -> Color
New Color
with HSL representation in sRGB colorspace.
Arguments
hue
- Hue channel. [0.0, 360.0]saturation
- Saturation channel. [0.0, 1.0]lightness
- Lightness channel. [0.0, 1.0]
See also Color::hsla
.
sourcepub const fn hsla(
hue: f32,
saturation: f32,
lightness: f32,
alpha: f32
) -> Color
pub const fn hsla( hue: f32, saturation: f32, lightness: f32, alpha: f32 ) -> Color
New Color
with HSL representation in sRGB colorspace.
Arguments
hue
- Hue channel. [0.0, 360.0]saturation
- Saturation channel. [0.0, 1.0]lightness
- Lightness channel. [0.0, 1.0]alpha
- Alpha channel. [0.0, 1.0]
See also Color::hsl
.
sourcepub const fn lch(lightness: f32, chroma: f32, hue: f32) -> Color
pub const fn lch(lightness: f32, chroma: f32, hue: f32) -> Color
New Color
with LCH representation in sRGB colorspace.
Arguments
lightness
- Lightness channel. [0.0, 1.5]chroma
- Chroma channel. [0.0, 1.5]hue
- Hue channel. [0.0, 360.0]
See also Color::lcha
.
sourcepub const fn lcha(lightness: f32, chroma: f32, hue: f32, alpha: f32) -> Color
pub const fn lcha(lightness: f32, chroma: f32, hue: f32, alpha: f32) -> Color
New Color
with LCH representation in sRGB colorspace.
Arguments
lightness
- Lightness channel. [0.0, 1.5]chroma
- Chroma channel. [0.0, 1.5]hue
- Hue channel. [0.0, 360.0]alpha
- Alpha channel. [0.0, 1.0]
See also Color::lch
.
sourcepub fn hex<T>(hex: T) -> Result<Color, HexColorError>
pub fn hex<T>(hex: T) -> Result<Color, HexColorError>
New Color
from sRGB colorspace.
Examples
let color = Color::hex("FF00FF").unwrap(); // fuchsia
let color = Color::hex("FF00FF7F").unwrap(); // partially transparent fuchsia
// A standard hex color notation is also available
assert_eq!(Color::hex("#FFFFFF").unwrap(), Color::rgb(1.0, 1.0, 1.0));
sourcepub fn rgb_u8(r: u8, g: u8, b: u8) -> Color
pub fn rgb_u8(r: u8, g: u8, b: u8) -> Color
New Color
from sRGB colorspace.
Arguments
r
- Red channel. [0, 255]g
- Green channel. [0, 255]b
- Blue channel. [0, 255]
See also Color::rgb
, Color::rgba_u8
, Color::hex
.
sourcepub fn rgba_u8(r: u8, g: u8, b: u8, a: u8) -> Color
pub fn rgba_u8(r: u8, g: u8, b: u8, a: u8) -> Color
New Color
from sRGB colorspace.
Arguments
r
- Red channel. [0, 255]g
- Green channel. [0, 255]b
- Blue channel. [0, 255]a
- Alpha channel. [0, 255]
See also Color::rgba
, Color::rgb_u8
, Color::hex
.
sourcepub fn r(&self) -> f32
pub fn r(&self) -> f32
Converts a Color to variant Color::Rgba
and return red in sRGB colorspace
sourcepub fn g(&self) -> f32
pub fn g(&self) -> f32
Converts a Color to variant Color::Rgba
and return green in sRGB colorspace
sourcepub fn b(&self) -> f32
pub fn b(&self) -> f32
Converts a Color to variant Color::Rgba
and return blue in sRGB colorspace
sourcepub fn set_r(&mut self, r: f32) -> &mut Color
pub fn set_r(&mut self, r: f32) -> &mut Color
Converts a Color to variant Color::Rgba
and set red
sourcepub fn with_r(self, r: f32) -> Color
pub fn with_r(self, r: f32) -> Color
Converts a Color to variant Color::Rgba
and return this color with red set to a new value
sourcepub fn set_g(&mut self, g: f32) -> &mut Color
pub fn set_g(&mut self, g: f32) -> &mut Color
Converts a Color to variant Color::Rgba
and set green
sourcepub fn with_g(self, g: f32) -> Color
pub fn with_g(self, g: f32) -> Color
Converts a Color to variant Color::Rgba
and return this color with green set to a new value
sourcepub fn set_b(&mut self, b: f32) -> &mut Color
pub fn set_b(&mut self, b: f32) -> &mut Color
Converts a Color to variant Color::Rgba
and set blue
sourcepub fn with_b(self, b: f32) -> Color
pub fn with_b(self, b: f32) -> Color
Converts a Color to variant Color::Rgba
and return this color with blue set to a new value
sourcepub fn h(&self) -> f32
pub fn h(&self) -> f32
Converts a Color to variant Color::Hsla
and return hue
sourcepub fn s(&self) -> f32
pub fn s(&self) -> f32
Converts a Color to variant Color::Hsla
and return saturation
sourcepub fn l(&self) -> f32
pub fn l(&self) -> f32
Converts a Color to variant Color::Hsla
and return lightness
sourcepub fn set_h(&mut self, h: f32) -> &mut Color
pub fn set_h(&mut self, h: f32) -> &mut Color
Converts a Color to variant Color::Hsla
and set hue
sourcepub fn with_h(self, h: f32) -> Color
pub fn with_h(self, h: f32) -> Color
Converts a Color to variant Color::Hsla
and return this color with hue set to a new value
sourcepub fn set_s(&mut self, s: f32) -> &mut Color
pub fn set_s(&mut self, s: f32) -> &mut Color
Converts a Color to variant Color::Hsla
and set saturation
sourcepub fn with_s(self, s: f32) -> Color
pub fn with_s(self, s: f32) -> Color
Converts a Color to variant Color::Hsla
and return this color with saturation set to a new value
sourcepub fn set_l(&mut self, l: f32) -> &mut Color
pub fn set_l(&mut self, l: f32) -> &mut Color
Converts a Color to variant Color::Hsla
and set lightness
sourcepub fn with_l(self, l: f32) -> Color
pub fn with_l(self, l: f32) -> Color
Converts a Color to variant Color::Hsla
and return this color with lightness set to a new value
sourcepub fn is_fully_transparent(&self) -> bool
pub fn is_fully_transparent(&self) -> bool
Determine if the color is fully transparent, i.e. if the alpha is 0.
Examples
// Fully transparent colors
assert!(Color::NONE.is_fully_transparent());
assert!(Color::rgba(1.0, 0.5, 0.5, 0.0).is_fully_transparent());
// (Partially) opaque colors
assert!(!Color::BLACK.is_fully_transparent());
assert!(!Color::rgba(1.0, 0.5, 0.5, 0.2).is_fully_transparent());
sourcepub fn as_rgba_linear(&self) -> Color
pub fn as_rgba_linear(&self) -> Color
Converts a Color
to variant Color::RgbaLinear
sourcepub fn as_rgba_u8(&self) -> [u8; 4]
pub fn as_rgba_u8(&self) -> [u8; 4]
Converts a Color
to a [u8; 4]
from sRGB colorspace
sourcepub fn as_rgba_f32(self) -> [f32; 4]
pub fn as_rgba_f32(self) -> [f32; 4]
Converts a Color
to a [f32; 4]
from sRGB colorspace
sourcepub fn as_linear_rgba_f32(self) -> [f32; 4]
pub fn as_linear_rgba_f32(self) -> [f32; 4]
Converts a Color
to a [f32; 4]
from linear RGB colorspace
sourcepub fn as_hsla_f32(self) -> [f32; 4]
pub fn as_hsla_f32(self) -> [f32; 4]
Converts a Color
to a [f32; 4]
from HSL colorspace
sourcepub fn as_lcha_f32(self) -> [f32; 4]
pub fn as_lcha_f32(self) -> [f32; 4]
Converts a Color
to a [f32; 4]
from LCH colorspace
sourcepub fn as_rgba_u32(self) -> u32
pub fn as_rgba_u32(self) -> u32
Converts Color
to a u32
from sRGB colorspace.
Maps the RGBA channels in RGBA order to a little-endian byte array (GPUs are little-endian).
A
will be the most significant byte and R
the least significant.
sourcepub fn as_linear_rgba_u32(self) -> u32
pub fn as_linear_rgba_u32(self) -> u32
Converts Color to a u32 from linear RGB colorspace.
Maps the RGBA channels in RGBA order to a little-endian byte array (GPUs are little-endian).
A
will be the most significant byte and R
the least significant.
sourcepub fn rgba_from_array(arr: impl Into<[f32; 4]>) -> Color
pub fn rgba_from_array(arr: impl Into<[f32; 4]>) -> Color
New Color
from [f32; 4]
(or a type that can be converted into them) with RGB representation in sRGB colorspace.
sourcepub fn rgb_from_array(arr: impl Into<[f32; 3]>) -> Color
pub fn rgb_from_array(arr: impl Into<[f32; 3]>) -> Color
New Color
from [f32; 3]
(or a type that can be converted into them) with RGB representation in sRGB colorspace.
sourcepub fn rgba_linear_from_array(arr: impl Into<[f32; 4]>) -> Color
pub fn rgba_linear_from_array(arr: impl Into<[f32; 4]>) -> Color
New Color
from [f32; 4]
(or a type that can be converted into them) with RGB representation in linear RGB colorspace.
sourcepub fn rgb_linear_from_array(arr: impl Into<[f32; 3]>) -> Color
pub fn rgb_linear_from_array(arr: impl Into<[f32; 3]>) -> Color
New Color
from [f32; 3]
(or a type that can be converted into them) with RGB representation in linear RGB colorspace.
sourcepub fn hsla_from_array(arr: impl Into<[f32; 4]>) -> Color
pub fn hsla_from_array(arr: impl Into<[f32; 4]>) -> Color
New Color
from [f32; 4]
(or a type that can be converted into them) with HSL representation in sRGB colorspace.
sourcepub fn hsl_from_array(arr: impl Into<[f32; 3]>) -> Color
pub fn hsl_from_array(arr: impl Into<[f32; 3]>) -> Color
New Color
from [f32; 3]
(or a type that can be converted into them) with HSL representation in sRGB colorspace.
sourcepub fn lcha_from_array(arr: impl Into<[f32; 4]>) -> Color
pub fn lcha_from_array(arr: impl Into<[f32; 4]>) -> Color
New Color
from [f32; 4]
(or a type that can be converted into them) with LCH representation in sRGB colorspace.
sourcepub fn lch_from_array(arr: impl Into<[f32; 3]>) -> Color
pub fn lch_from_array(arr: impl Into<[f32; 3]>) -> Color
New Color
from [f32; 3]
(or a type that can be converted into them) with LCH representation in sRGB colorspace.
sourcepub fn rgba_to_vec4(&self) -> Vec4
pub fn rgba_to_vec4(&self) -> Vec4
Convert Color
to RGBA and return as Vec4
.
sourcepub fn rgb_to_vec3(&self) -> Vec3
pub fn rgb_to_vec3(&self) -> Vec3
Convert Color
to RGBA and return as Vec3
.
sourcepub fn rgba_linear_to_vec4(&self) -> Vec4
pub fn rgba_linear_to_vec4(&self) -> Vec4
Convert Color
to linear RGBA and return as Vec4
.
sourcepub fn rgb_linear_to_vec3(&self) -> Vec3
pub fn rgb_linear_to_vec3(&self) -> Vec3
Convert Color
to linear RGBA and return as Vec3
.
sourcepub fn hsla_to_vec4(&self) -> Vec4
pub fn hsla_to_vec4(&self) -> Vec4
Convert Color
to HSLA and return as Vec4
.
sourcepub fn hsl_to_vec3(&self) -> Vec3
pub fn hsl_to_vec3(&self) -> Vec3
Convert Color
to HSLA and return as Vec3
.
sourcepub fn lcha_to_vec4(&self) -> Vec4
pub fn lcha_to_vec4(&self) -> Vec4
Convert Color
to LCHA and return as Vec4
.
sourcepub fn lch_to_vec3(&self) -> Vec3
pub fn lch_to_vec3(&self) -> Vec3
Convert Color
to LCHA and return as Vec3
.
Trait Implementations§
source§impl CreateFrom for Color
impl CreateFrom for Color
source§impl<'de> Deserialize<'de> for Color
impl<'de> Deserialize<'de> for Color
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Color, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Color, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl Enum for Color
impl Enum for Color
source§fn field(&self, __name_param: &str) -> Option<&(dyn Reflect + 'static)>
fn field(&self, __name_param: &str) -> Option<&(dyn Reflect + 'static)>
source§fn field_at(&self, __index_param: usize) -> Option<&(dyn Reflect + 'static)>
fn field_at(&self, __index_param: usize) -> Option<&(dyn Reflect + 'static)>
source§fn field_mut(
&mut self,
__name_param: &str
) -> Option<&mut (dyn Reflect + 'static)>
fn field_mut( &mut self, __name_param: &str ) -> Option<&mut (dyn Reflect + 'static)>
source§fn field_at_mut(
&mut self,
__index_param: usize
) -> Option<&mut (dyn Reflect + 'static)>
fn field_at_mut( &mut self, __index_param: usize ) -> Option<&mut (dyn Reflect + 'static)>
source§fn index_of(&self, __name_param: &str) -> Option<usize>
fn index_of(&self, __name_param: &str) -> Option<usize>
source§fn name_at(&self, __index_param: usize) -> Option<&str>
fn name_at(&self, __index_param: usize) -> Option<&str>
source§fn iter_fields(&self) -> VariantFieldIter<'_> ⓘ
fn iter_fields(&self) -> VariantFieldIter<'_> ⓘ
source§fn variant_name(&self) -> &str
fn variant_name(&self) -> &str
source§fn variant_index(&self) -> usize
fn variant_index(&self) -> usize
source§fn variant_type(&self) -> VariantType
fn variant_type(&self) -> VariantType
fn clone_dynamic(&self) -> DynamicEnum
source§fn is_variant(&self, variant_type: VariantType) -> bool
fn is_variant(&self, variant_type: VariantType) -> bool
source§fn variant_path(&self) -> String
fn variant_path(&self) -> String
source§impl From<Color> for BackgroundColor
impl From<Color> for BackgroundColor
source§fn from(color: Color) -> BackgroundColor
fn from(color: Color) -> BackgroundColor
source§impl From<Color> for BorderColor
impl From<Color> for BorderColor
source§fn from(color: Color) -> BorderColor
fn from(color: Color) -> BorderColor
source§impl From<Color> for ClearColorConfig
impl From<Color> for ClearColorConfig
source§fn from(color: Color) -> ClearColorConfig
fn from(color: Color) -> ClearColorConfig
source§impl From<Color> for ColorMaterial
impl From<Color> for ColorMaterial
source§fn from(color: Color) -> ColorMaterial
fn from(color: Color) -> ColorMaterial
source§impl From<Color> for StandardMaterial
impl From<Color> for StandardMaterial
source§fn from(color: Color) -> StandardMaterial
fn from(color: Color) -> StandardMaterial
source§impl FromReflect for Color
impl FromReflect for Color
source§fn from_reflect(__param0: &(dyn Reflect + 'static)) -> Option<Color>
fn from_reflect(__param0: &(dyn Reflect + 'static)) -> Option<Color>
Self
from a reflected value.source§fn take_from_reflect(
reflect: Box<dyn Reflect>
) -> Result<Self, Box<dyn Reflect>>
fn take_from_reflect( reflect: Box<dyn Reflect> ) -> Result<Self, Box<dyn Reflect>>
Self
using,
constructing the value using from_reflect
if that fails. Read moresource§impl GetTypeRegistration for Color
impl GetTypeRegistration for Color
source§impl MulAssign<Vec3> for Color
impl MulAssign<Vec3> for Color
source§fn mul_assign(&mut self, rhs: Vec3)
fn mul_assign(&mut self, rhs: Vec3)
*=
operation. Read moresource§impl MulAssign<Vec4> for Color
impl MulAssign<Vec4> for Color
source§fn mul_assign(&mut self, rhs: Vec4)
fn mul_assign(&mut self, rhs: Vec4)
*=
operation. Read moresource§impl MulAssign<f32> for Color
impl MulAssign<f32> for Color
source§fn mul_assign(&mut self, rhs: f32)
fn mul_assign(&mut self, rhs: f32)
*=
operation. Read moresource§impl PartialEq for Color
impl PartialEq for Color
source§impl Reflect for Color
impl Reflect for Color
source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut dyn Any
.source§fn into_reflect(self: Box<Color>) -> Box<dyn Reflect>
fn into_reflect(self: Box<Color>) -> Box<dyn Reflect>
source§fn as_reflect(&self) -> &(dyn Reflect + 'static)
fn as_reflect(&self) -> &(dyn Reflect + 'static)
source§fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)
source§fn clone_value(&self) -> Box<dyn Reflect>
fn clone_value(&self) -> Box<dyn Reflect>
Reflect
trait object. Read moresource§fn set(
&mut self,
__value_param: Box<dyn Reflect>
) -> Result<(), Box<dyn Reflect>>
fn set( &mut self, __value_param: Box<dyn Reflect> ) -> Result<(), Box<dyn Reflect>>
source§fn apply(&mut self, __value_param: &(dyn Reflect + 'static))
fn apply(&mut self, __value_param: &(dyn Reflect + 'static))
source§fn reflect_kind(&self) -> ReflectKind
fn reflect_kind(&self) -> ReflectKind
source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
source§fn reflect_owned(self: Box<Color>) -> ReflectOwned
fn reflect_owned(self: Box<Color>) -> ReflectOwned
source§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
source§fn reflect_partial_eq(&self, value: &(dyn Reflect + 'static)) -> Option<bool>
fn reflect_partial_eq(&self, value: &(dyn Reflect + 'static)) -> Option<bool>
source§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
source§fn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
source§impl Serialize for Color
impl Serialize for Color
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,
source§impl ShaderSize for Color
impl ShaderSize for Color
source§const SHADER_SIZE: NonZeroU64 = _
const SHADER_SIZE: NonZeroU64 = _
ShaderType::min_size
)source§impl ShaderType for Color
impl ShaderType for Color
source§fn min_size() -> NonZeroU64
fn min_size() -> NonZeroU64
source§fn size(&self) -> NonZeroU64
fn size(&self) -> NonZeroU64
Self
at runtime Read moresource§fn assert_uniform_compat()
fn assert_uniform_compat()
Self
meets the requirements of the
uniform address space restrictions on stored values and the
uniform address space layout constraints Read moresource§impl TypePath for Color
impl TypePath for Color
source§fn type_path() -> &'static str
fn type_path() -> &'static str
source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
source§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
source§fn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
source§impl WriteInto for Color
impl WriteInto for Color
fn write_into<B>(&self, writer: &mut Writer<B>)where
B: BufferMut,
impl Copy for Color
impl StructuralPartialEq for Color
Auto Trait Implementations§
impl RefUnwindSafe for Color
impl Send for Color
impl Sync for Color
impl Unpin for Color
impl UnwindSafe for Color
Blanket Implementations§
source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
ShaderType
for self
. When used in AsBindGroup
derives, it is safe to assume that all images in self
exist.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
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere
T: TypePath,
source§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
TypePath::type_path
.source§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
source§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
TypePath::type_ident
.source§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
TypePath::crate_name
.source§fn reflect_module_path(&self) -> Option<&str>
fn reflect_module_path(&self) -> Option<&str>
source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given World
.source§impl<T> GetPath for T
impl<T> GetPath for T
source§fn reflect_path<'p>(
&self,
path: impl ReflectPath<'p>
) -> Result<&(dyn Reflect + 'static), ReflectPathError<'p>>
fn reflect_path<'p>( &self, path: impl ReflectPath<'p> ) -> Result<&(dyn Reflect + 'static), ReflectPathError<'p>>
path
. Read moresource§fn reflect_path_mut<'p>(
&mut self,
path: impl ReflectPath<'p>
) -> Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p> ) -> Result<&mut (dyn Reflect + 'static), ReflectPathError<'p>>
path
. Read moresource§fn path<'p, T>(
&self,
path: impl ReflectPath<'p>
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
fn path<'p, T>(
&self,
path: impl ReflectPath<'p>
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
path
. Read moresource§fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
path
. Read more