pub struct GlobalScriptVariableRef<'a>(_, _);
Expand description

Reference to a global script variable, see ScriptVariableRead.

Trait Implementations§

source§

impl<'a> PartialEq<GlobalScriptVariableRef<'a>> for GlobalScriptVariableRef<'a>

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§

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.
source§

impl<'a> ScriptVariableRead for GlobalScriptVariableRef<'a>

source§

fn id(&self) -> ScriptVariableId

Returns the variable ID
source§

fn descriptor(&self) -> &script_var

Loads a script variable descriptor for a given ID.
source§

fn is_local(&self) -> bool

Returns whether or not this is a local variable (as opposed to a global one).
source§

fn var_type(&self) -> ScriptVariableValueType

Returns the type of the variable
source§

fn is_array(&self) -> bool

Returns whether or not the variable is an array.
source§

fn capacity(&self) -> usize

Returns the number of elements in the array or 1 if it’s not an array.
source§

fn name(&self) -> &str

Returns the name of the variable.
source§

fn value_raw(&self) -> i32

Loads the value of a script variable. If this variable is an array, the value at index 0 is returned. Read more
source§

fn value_raw_indexed(&self, index: i32) -> i32

Loads the value of a script variable at some index (for script variables that are arrays). Read more
source§

fn value(&self) -> ScriptVariableValue

Loads the value of a script variable. Read more
source§

fn value_indexed(&self, index: i32) -> ScriptVariableValue

Loads the value of a script variable at some index (for script variables that are arrays). Read more
source§

fn sum(&self) -> i32

Loads the sum of all values of the script variable (for script variables that are arrays).
source§

fn var_eq<S: AsScriptVariableId>(&self, other: S) -> bool

Checks if two script variables have equal values. For arrays, compares elementwise for the length of the first variable. Read more
source§

impl<'a> Eq for GlobalScriptVariableRef<'a>

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for GlobalScriptVariableRef<'a>

§

impl<'a> Send for GlobalScriptVariableRef<'a>

§

impl<'a> Sync for GlobalScriptVariableRef<'a>

§

impl<'a> Unpin for GlobalScriptVariableRef<'a>

§

impl<'a> UnwindSafe for GlobalScriptVariableRef<'a>

Blanket Implementations§

§

impl<T> Any for Twhere T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AsScriptVariableId for Twhere T: ScriptVariableRead,

source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dstwhere T: Cast<Dst>,

Casts the value.
§

impl<T> Borrow<T> for Twhere T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dstwhere Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for Twhere U: From<T>,

§

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<Src, Dst> LosslessTryInto<Dst> for Srcwhere Dst: LosslessTryFrom<Src>,

source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
source§

impl<Src, Dst> LossyInto<Dst> for Srcwhere Dst: LossyFrom<Src>,

source§

fn lossy_into(self) -> Dst

Performs the conversion.
source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dstwhere T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dstwhere T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dstwhere T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.