pub struct FieldInfo<'a, 'b> {
Show 14 fields pub owner_type_id: TypeId, pub name: &'b str, pub display_name: &'b str, pub description: &'b str, pub type_name: &'b str, pub doc: &'b str, pub value: &'a dyn FieldValue, pub reflect_value: &'a dyn Reflect, pub read_only: bool, pub immutable_collection: bool, pub min_value: Option<f64>, pub max_value: Option<f64>, pub step: Option<f64>, pub precision: Option<usize>,
}

Fields§

§owner_type_id: TypeId

A type id of the owner of the property.

§name: &'b str

A name of the property.

§display_name: &'b str

A human-readable name of the property.

§description: &'b str

Description of the property.

§type_name: &'b str

Type name of the property.

§doc: &'b str

Doc comment content.

§value: &'a dyn FieldValue

An reference to the actual value of the property. This is “non-mangled” reference, which means that while field/fields/field_mut/fields_mut might return a reference to other value, than the actual field, the value is guaranteed to be a reference to the real value.

§reflect_value: &'a dyn Reflect

A reference to the value casted to Reflect.

§read_only: bool

A property is not meant to be edited.

§immutable_collection: bool

Only for dynamic collections (Vec, etc) - means that its size cannot be changed, however the items of the collection can still be changed.

§min_value: Option<f64>

A minimal value of the property. Works only with numeric properties!

§max_value: Option<f64>

A minimal value of the property. Works only with numeric properties!

§step: Option<f64>

A minimal value of the property. Works only with numeric properties!

§precision: Option<usize>

Maximum amount of decimal places for a numeric property.

Implementations§

source§

impl<'a, 'b> FieldInfo<'a, 'b>

source

pub fn cast_value<T: 'static>(&self) -> Result<&T, CastError>

Tries to cast a value to a given type.

Trait Implementations§

source§

impl<'a, 'b> Debug for FieldInfo<'a, 'b>

source§

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

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

impl<'a, 'b> PartialEq for FieldInfo<'a, 'b>

source§

fn eq(&self, other: &Self) -> 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.

Auto Trait Implementations§

§

impl<'a, 'b> !RefUnwindSafe for FieldInfo<'a, 'b>

§

impl<'a, 'b> !Send for FieldInfo<'a, 'b>

§

impl<'a, 'b> !Sync for FieldInfo<'a, 'b>

§

impl<'a, 'b> Unpin for FieldInfo<'a, 'b>

§

impl<'a, 'b> !UnwindSafe for FieldInfo<'a, 'b>

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> FieldValue for T
where T: 'static,

source§

fn as_any(&self) -> &(dyn Any + 'static)

Casts self to a &dyn Any
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> Same for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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