Enum hotg_rune_core::Value
source · [−]#[non_exhaustive]
pub enum Value {
Byte(u8),
Short(i16),
Integer(i32),
Float(f32),
SignedByte(i8),
}
Expand description
A dynamically typed value that may be passed back and forth across the runtime.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Byte(u8)
Short(i16)
Integer(i32)
Float(f32)
SignedByte(i8)
Implementations
sourceimpl Value
impl Value
pub fn from_le_bytes(ty: Type, bytes: &[u8]) -> Option<Self>
sourcepub fn to_le_bytes(self, buffer: &mut [u8]) -> usize
pub fn to_le_bytes(self, buffer: &mut [u8]) -> usize
Write this Value
’s underlying value to the start of the provided
buffer, returning the number of bytes written.
The buffer should have at least core::mem::size_of::<Value>()
bytes.
You can use the Value::buffer()
helper for creating an adequately
sized buffer.
pub fn ty(&self) -> Type
Trait Implementations
sourceimpl From<PixelFormat> for Value
impl From<PixelFormat> for Value
sourcefn from(p: PixelFormat) -> Value
fn from(p: PixelFormat) -> Value
Performs the conversion.
sourceimpl PartialOrd<Value> for Value
impl PartialOrd<Value> for Value
sourcefn partial_cmp(&self, other: &Value) -> Option<Ordering>
fn partial_cmp(&self, other: &Value) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl TryFrom<Value> for PixelFormat
impl TryFrom<Value> for PixelFormat
type Error = PixelFormatConversionError
type Error = PixelFormatConversionError
The type returned in the event of a conversion error.
impl Copy for Value
impl StructuralPartialEq for Value
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more