Enum valence_nbt::value::ValueMut
source · pub enum ValueMut<'a, S = String> {
Byte(&'a mut i8),
Short(&'a mut i16),
Int(&'a mut i32),
Long(&'a mut i64),
Float(&'a mut f32),
Double(&'a mut f64),
ByteArray(&'a mut Vec<i8>),
String(&'a mut S),
List(&'a mut List<S>),
Compound(&'a mut Compound<S>),
IntArray(&'a mut Vec<i32>),
LongArray(&'a mut Vec<i64>),
}
Expand description
Represents a mutable reference to an arbitrary NBT value, where the tag is not part of the reference.
Variants§
Byte(&'a mut i8)
Short(&'a mut i16)
Int(&'a mut i32)
Long(&'a mut i64)
Float(&'a mut f32)
Double(&'a mut f64)
ByteArray(&'a mut Vec<i8>)
String(&'a mut S)
List(&'a mut List<S>)
Compound(&'a mut Compound<S>)
IntArray(&'a mut Vec<i32>)
LongArray(&'a mut Vec<i64>)
Implementations§
source§impl<'a, S> ValueMut<'a, S>
impl<'a, S> ValueMut<'a, S>
sourcepub fn is_number(&self) -> bool
pub fn is_number(&self) -> bool
Returns whether this value is a number, i.e. a byte, short, int, long, float or double.
sourcepub fn as_i8(&self) -> Option<i8>
pub fn as_i8(&self) -> Option<i8>
If this value is a number, returns the i8
representation of this value.
sourcepub fn as_i16(&self) -> Option<i16>
pub fn as_i16(&self) -> Option<i16>
If this value is a number, returns the i16
representation of this value.
sourcepub fn as_i32(&self) -> Option<i32>
pub fn as_i32(&self) -> Option<i32>
If this value is a number, returns the i32
representation of this value.
sourcepub fn as_i64(&self) -> Option<i64>
pub fn as_i64(&self) -> Option<i64>
If this value is a number, returns the i64
representation of this value.
sourcepub fn as_f32(&self) -> Option<f32>
pub fn as_f32(&self) -> Option<f32>
If this value is a number, returns the f32
representation of this value.
Trait Implementations§
Auto Trait Implementations§
impl<'a, S> Freeze for ValueMut<'a, S>
impl<'a, S> RefUnwindSafe for ValueMut<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for ValueMut<'a, S>where
S: Send,
impl<'a, S> Sync for ValueMut<'a, S>where
S: Sync,
impl<'a, S> Unpin for ValueMut<'a, S>
impl<'a, S = String> !UnwindSafe for ValueMut<'a, S>
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