pub enum Type {
AnyScalar,
Void,
Entity,
Function,
Vector,
Float,
String,
}Expand description
The possible types of values exposed to the host.
NOTE: These do not represent all possible types of values internal to the QuakeC runtime. QuakeC has “entity field” and “pointer” types - which are relative pointers within entities and absolute pointers to globals respectively - but these are implementation details due to some quirks about how QuakeC’s opcodes are defined. The values exposed to the host are deliberately limited to values that are exposed when writing QuakeC code.
Variants§
AnyScalar
Any scalar value. If a function wants to be generic in its arguments, it can specify
Type::AnyScalar in its arguments. The only non-scalar type is vector, and for now
it is not possible to be generic over both scalars and vectors in the same argument.
Void
Corresponds to QuakeC’s void. Should rarely be used, and is mostly
for the return value of functions that do not return any sensible value.
Entity
An entity reference. See documentation for EntityRef for more details.
Function
A function pointer. This requires some context to call, see userdata::Function.
Vector
An {x, y, z} vector value.
Float
A single scalar float.
String
A refcounted string pointer. Quake strings are not strictly ascii, but cannot have internal
NUL, so CStr is used.
Trait Implementations§
impl Copy for Type
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more