pub enum Value {
Null,
Number(f64),
Array(Vec<Value>),
Boolean(bool),
String(String),
Unknown(String),
}Expand description
A value that can be converted to and from Arma types.
Variants§
Null
Arma’s nil value.
Represented as null
Number(f64)
Arma’s number value.
Array(Vec<Value>)
Arma’s array value.
Represented as [...]
Boolean(bool)
Arma’s boolean value.
Represented as true or false
String(String)
Arma’s string value.
Represented as "..."
Note: Arma escapes quotes with two double quotes.
This conversation will remove one step of escaping.
Example: "My name is ""John""." will become My name is "John".
Unknown(String)
Unknown value. Contains the raw string.
Implementations§
Source§impl Value
impl Value
Sourcepub fn direct(value: Value) -> DirectReturn
pub fn direct(value: Value) -> DirectReturn
A workaround to return a value directly to Arma
Source§impl Value
impl Value
Sourcepub const fn as_f64(&self) -> Option<f64>
pub const fn as_f64(&self) -> Option<f64>
Returns an Option representing if the value is a number
Sourcepub const fn as_vec(&self) -> Option<&Vec<Self>>
pub const fn as_vec(&self) -> Option<&Vec<Self>>
Returns an Option representing if the value is an array
Sourcepub const fn as_bool(&self) -> Option<bool>
pub const fn as_bool(&self) -> Option<bool>
Returns an Option representing if the value is a boolean
Sourcepub const fn is_boolean(&self) -> bool
pub const fn is_boolean(&self) -> bool
Checks if the value is a boolean
Trait Implementations§
Source§impl IntoExtResult for Value
impl IntoExtResult for Value
Source§impl PartialOrd for Value
impl PartialOrd for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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
Mutably borrows from an owned value. Read more