[−][src]Struct hl_capture::engine::Engine
A "container" for unsafe engine functions.
It's used for exposing safe interfaces for these functions where they can be used safely (for example, in console command handlers). Engine also serves as a static guarantee of being in the main game thread.
Fields
_private: PhantomData<*const ()>This field serves two purposes: firstly, it prevents creating the struct not via the unsafe new() method, and secondly, it marks the struct as !Send and !Sync.
Methods
impl Engine[src]
pub unsafe fn new() -> Self[src]
Creates an instance of Engine.
Safety
Unsafe because this function should only be called from the main game thread.
pub fn marker(&self) -> (&Self, MainThreadMarker)[src]
Splits off a MainThreadMarker.
pub fn marker_mut(&mut self) -> (&mut Self, MainThreadMarker)[src]
Splits off a MainThreadMarker from a mutable reference.
pub fn data(&self) -> &MainThreadData[src]
Returns a reference to the main thread global variables.
pub fn data_mut(&mut self) -> &mut MainThreadData[src]
Returns a mutable reference to the main thread global variables.
ⓘImportant traits for Args<'_>pub fn args(&self) -> Args[src]
Returns an iterator over the console command arguments.
pub fn con_print(&self, string: &str)[src]
Prints the given string to the game console.
pub fn cmd_argc(&self) -> u32[src]
Returns the number of console command arguments.
pub fn cmd_argv(&self, index: u32) -> String[src]
Returns the console command argument with the given index.
pub fn register_variable(&mut self, cvar: &CVar) -> Result<(), Error>[src]
Registers the given console variable.
pub fn get_engine_cvar(&mut self, cvar: &CVar) -> EngineCVarGuard[src]
Returns the engine CVar wrapped by the given CVar.
Takes a mutable reference to Engine to statically ensure that no engine functions are called while the engine CVar reference is valid.
Auto Trait Implementations
impl Unpin for Engine
impl !Sync for Engine
impl !Send for Engine
impl RefUnwindSafe for Engine
impl UnwindSafe for Engine
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,