pub enum FieldValue {
}Expand description
Value type for entity properties.
This enum represents all possible types that can be stored in entity properties.
Use TryInto to convert to Rust types, or use the property! macro for
convenient access.
§Variants
- Numeric types:
i8,i16,i32,i64,u8,u16,u32,u64 - Floating point:
f32 - Text:
String - Vectors: 2D, 3D, and 4D float arrays
- Boolean:
bool
§Examples
§Manual conversion
use source2_demo::prelude::*;
let field_value = entity.get_property_by_name("m_iHealth")?;
let health: i32 = field_value.try_into()?;
println!("Health: {}", health);§Using property! macro
use source2_demo::prelude::*;
// Type is inferred
let health: i32 = property!(entity, "m_iHealth");Variants§
Boolean(bool)
Boolean value
String(String)
String value
Float(f32)
32-bit floating point value
Vector2D([f32; 2])
2D vector
Vector3D([f32; 3])
3D vector
Vector4D([f32; 4])
4D vector
Signed8(i8)
Signed 8-bit integer
Signed16(i16)
Signed 16-bit integer
Signed32(i32)
Signed 32-bit integer
Signed64(i64)
Signed 64-bit integer
Unsigned8(u8)
Unsigned 8-bit integer
Unsigned16(u16)
Unsigned 16-bit integer
Unsigned32(u32)
Unsigned 32-bit integer
Unsigned64(u64)
Unsigned 64-bit integer
Trait Implementations§
Source§impl Clone for FieldValue
impl Clone for FieldValue
Source§fn clone(&self) -> FieldValue
fn clone(&self) -> FieldValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FieldValue
impl Debug for FieldValue
Source§impl Display for FieldValue
impl Display for FieldValue
Source§impl PartialEq for FieldValue
impl PartialEq for FieldValue
Source§impl TryInto<String> for &FieldValue
impl TryInto<String> for &FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<String> for FieldValue
impl TryInto<String> for FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<bool> for &FieldValue
impl TryInto<bool> for &FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<bool> for FieldValue
impl TryInto<bool> for FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<f32> for &FieldValue
impl TryInto<f32> for &FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<f32> for FieldValue
impl TryInto<f32> for FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<i128> for &FieldValue
impl TryInto<i128> for &FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<i128> for FieldValue
impl TryInto<i128> for FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<i16> for &FieldValue
impl TryInto<i16> for &FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<i16> for FieldValue
impl TryInto<i16> for FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<i32> for &FieldValue
impl TryInto<i32> for &FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<i32> for FieldValue
impl TryInto<i32> for FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<i64> for &FieldValue
impl TryInto<i64> for &FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<i64> for FieldValue
impl TryInto<i64> for FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<i8> for &FieldValue
impl TryInto<i8> for &FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<i8> for FieldValue
impl TryInto<i8> for FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<isize> for &FieldValue
impl TryInto<isize> for &FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<isize> for FieldValue
impl TryInto<isize> for FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<u128> for &FieldValue
impl TryInto<u128> for &FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<u128> for FieldValue
impl TryInto<u128> for FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<u16> for &FieldValue
impl TryInto<u16> for &FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<u16> for FieldValue
impl TryInto<u16> for FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<u32> for &FieldValue
impl TryInto<u32> for &FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<u32> for FieldValue
impl TryInto<u32> for FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<u64> for &FieldValue
impl TryInto<u64> for &FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<u64> for FieldValue
impl TryInto<u64> for FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<u8> for &FieldValue
impl TryInto<u8> for &FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<u8> for FieldValue
impl TryInto<u8> for FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<usize> for &FieldValue
impl TryInto<usize> for &FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
Source§impl TryInto<usize> for FieldValue
impl TryInto<usize> for FieldValue
Source§type Error = FieldValueError
type Error = FieldValueError
The type returned in the event of a conversion error.
impl StructuralPartialEq for FieldValue
Auto Trait Implementations§
impl Freeze for FieldValue
impl RefUnwindSafe for FieldValue
impl Send for FieldValue
impl Sync for FieldValue
impl Unpin for FieldValue
impl UnsafeUnpin for FieldValue
impl UnwindSafe for FieldValue
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