[−][src]Struct hl_capture::cvar::CVar
Safe wrapper for the engine CVar type.
Fields
engine_cvar: *mut cvar_tThis field has to be public because there's no const fn. It shouldn't be accessed manually.
default_value: &'static strThis field has to be public because there's no const fn. It shouldn't be accessed manually.
name: &'static strThis field has to be public because there's no const fn. It shouldn't be accessed manually.
Methods
impl CVar[src]
pub unsafe fn get_engine_cvar(&self) -> &'static mut cvar_t[src]
Retrieves a mutable reference to the engine CVar.
Safety
Unsafe because this function should only be called from the main game thread. You should also ensure that you don't call any engine functions while holding this reference, because the game also has a mutable reference to this CVar.
pub fn register(&self, engine: &mut Engine) -> Result<(), Error>[src]
Registers this console variable.
pub fn to_string(&self, engine: &mut Engine) -> Result<String, Error>[src]
Returns the string this variable is set to.
pub fn parse<T>(&self, engine: &mut Engine) -> Result<T, Error> where
T: FromStr,
<T as FromStr>::Err: Fail, [src]
T: FromStr,
<T as FromStr>::Err: Fail,
Tries parsing this variable's value to the desired type.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
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>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
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>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,