Enum gml_parser::gml::Value
source · pub enum Value<'a> {
Int(i32),
Float(f32),
Str(Cow<'a, str>),
}
Expand description
The base value types supported by GML.
Variants§
Implementations§
source§impl<'a> Value<'a>
impl<'a> Value<'a>
sourcepub fn as_str(self) -> Option<Cow<'a, str>>
pub fn as_str(self) -> Option<Cow<'a, str>>
Returns a string if the value is a string. Otherwise returns None
.
sourcepub fn as_float(self) -> Option<f32>
pub fn as_float(self) -> Option<f32>
Returns a float if the value is a float. Otherwise returns None
.
sourcepub fn upgrade_to_owned(&self) -> Value<'static>
pub fn upgrade_to_owned(&self) -> Value<'static>
Convert any borrowed references to owned values.
Trait Implementations§
impl<'a> StructuralPartialEq for Value<'a>
Auto Trait Implementations§
impl<'a> Freeze for Value<'a>
impl<'a> RefUnwindSafe for Value<'a>
impl<'a> Send for Value<'a>
impl<'a> Sync for Value<'a>
impl<'a> Unpin for Value<'a>
impl<'a> UnwindSafe for Value<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)