Skip to main content

EventValue

Enum EventValue 

Source
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

Source§

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

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

impl TryInto<String> for &EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<String, GameEventError>

Performs the conversion.
Source§

impl TryInto<String> for EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<String, GameEventError>

Performs the conversion.
Source§

impl TryInto<bool> for &EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<bool, GameEventError>

Performs the conversion.
Source§

impl TryInto<bool> for EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<bool, GameEventError>

Performs the conversion.
Source§

impl TryInto<f32> for &EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<f32, GameEventError>

Performs the conversion.
Source§

impl TryInto<f32> for EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<f32, GameEventError>

Performs the conversion.
Source§

impl TryInto<i128> for &EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<i128, GameEventError>

Performs the conversion.
Source§

impl TryInto<i128> for EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<i128, GameEventError>

Performs the conversion.
Source§

impl TryInto<i16> for &EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<i16, GameEventError>

Performs the conversion.
Source§

impl TryInto<i16> for EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<i16, GameEventError>

Performs the conversion.
Source§

impl TryInto<i32> for &EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<i32, GameEventError>

Performs the conversion.
Source§

impl TryInto<i32> for EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<i32, GameEventError>

Performs the conversion.
Source§

impl TryInto<i64> for &EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<i64, GameEventError>

Performs the conversion.
Source§

impl TryInto<i64> for EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<i64, GameEventError>

Performs the conversion.
Source§

impl TryInto<i8> for &EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<i8, GameEventError>

Performs the conversion.
Source§

impl TryInto<i8> for EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<i8, GameEventError>

Performs the conversion.
Source§

impl TryInto<isize> for &EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<isize, GameEventError>

Performs the conversion.
Source§

impl TryInto<isize> for EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<isize, GameEventError>

Performs the conversion.
Source§

impl TryInto<u128> for &EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<u128, GameEventError>

Performs the conversion.
Source§

impl TryInto<u128> for EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<u128, GameEventError>

Performs the conversion.
Source§

impl TryInto<u16> for &EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<u16, GameEventError>

Performs the conversion.
Source§

impl TryInto<u16> for EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<u16, GameEventError>

Performs the conversion.
Source§

impl TryInto<u32> for &EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<u32, GameEventError>

Performs the conversion.
Source§

impl TryInto<u32> for EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<u32, GameEventError>

Performs the conversion.
Source§

impl TryInto<u64> for &EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<u64, GameEventError>

Performs the conversion.
Source§

impl TryInto<u64> for EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<u64, GameEventError>

Performs the conversion.
Source§

impl TryInto<u8> for &EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<u8, GameEventError>

Performs the conversion.
Source§

impl TryInto<u8> for EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<u8, GameEventError>

Performs the conversion.
Source§

impl TryInto<usize> for &EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<usize, GameEventError>

Performs the conversion.
Source§

impl TryInto<usize> for EventValue

Source§

type Error = GameEventError

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<usize, GameEventError>

Performs the conversion.

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

Source§

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

Source§

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.