pub enum EventValue {
String(String),
Float(f32),
Int(i32),
Bool(bool),
Byte(u8),
U64(u64),
}Expand description
Value type for game event fields.
Game events contain named fields with values. This enum represents all possible value types that can appear in game events.
§Examples
use source2_demo::prelude::*;
// Get a value and convert it
let value = ge.get_value("player_id")?;
let player_id: i32 = value.try_into()?;Variants§
String(String)
String value
Float(f32)
32-bit floating point value
Int(i32)
Signed 32-bit integer
Bool(bool)
Boolean value
Byte(u8)
Unsigned 8-bit integer (byte)
U64(u64)
Unsigned 64-bit integer
Trait Implementations§
Source§impl Debug for EventValue
impl Debug for EventValue
Source§impl TryInto<String> for &EventValue
impl TryInto<String> for &EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<String> for EventValue
impl TryInto<String> for EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<bool> for &EventValue
impl TryInto<bool> for &EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<bool> for EventValue
impl TryInto<bool> for EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<f32> for &EventValue
impl TryInto<f32> for &EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<f32> for EventValue
impl TryInto<f32> for EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<i128> for &EventValue
impl TryInto<i128> for &EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<i128> for EventValue
impl TryInto<i128> for EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<i16> for &EventValue
impl TryInto<i16> for &EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<i16> for EventValue
impl TryInto<i16> for EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<i32> for &EventValue
impl TryInto<i32> for &EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<i32> for EventValue
impl TryInto<i32> for EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<i64> for &EventValue
impl TryInto<i64> for &EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<i64> for EventValue
impl TryInto<i64> for EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<i8> for &EventValue
impl TryInto<i8> for &EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<i8> for EventValue
impl TryInto<i8> for EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<isize> for &EventValue
impl TryInto<isize> for &EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<isize> for EventValue
impl TryInto<isize> for EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<u128> for &EventValue
impl TryInto<u128> for &EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<u128> for EventValue
impl TryInto<u128> for EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<u16> for &EventValue
impl TryInto<u16> for &EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<u16> for EventValue
impl TryInto<u16> for EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<u32> for &EventValue
impl TryInto<u32> for &EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<u32> for EventValue
impl TryInto<u32> for EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<u64> for &EventValue
impl TryInto<u64> for &EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<u64> for EventValue
impl TryInto<u64> for EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<u8> for &EventValue
impl TryInto<u8> for &EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<u8> for EventValue
impl TryInto<u8> for EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<usize> for &EventValue
impl TryInto<usize> for &EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Source§impl TryInto<usize> for EventValue
impl TryInto<usize> for EventValue
Source§type Error = GameEventError
type Error = GameEventError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for EventValue
impl RefUnwindSafe for EventValue
impl Send for EventValue
impl Sync for EventValue
impl Unpin for EventValue
impl UnsafeUnpin for EventValue
impl UnwindSafe for EventValue
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