pub enum GuraType {
Show 17 variants
Null,
Indentation(usize),
UselessLine,
Pair(String, Box<GuraType>, usize),
Comment,
Import(String),
Variable,
ObjectWithWs(IndexMap<String, GuraType>, usize),
Object(IndexMap<String, GuraType>),
Bool(bool),
String(String),
Integer(isize),
BigInteger(i128),
Float(f64),
Array(Vec<GuraType>),
WsOrNewLine,
BreakParent,
}
Expand description
Data types to be returned by match expression methods.
Variants§
Null
Null values.
Indentation(usize)
Indentation (intended to be used internally).
UselessLine
An empty line (intended to be used internally).
Pair(String, Box<GuraType>, usize)
Pair of key/value. (intended to be used internally. Users normally uses Object to map key/values).
Comment
Comment (intended to be used internally).
Import(String)
Importing sentence (intended to be used internally).
Variable
Indicates matching with a variable definition (intended to be used internally).
ObjectWithWs(IndexMap<String, GuraType>, usize)
Object with information about indentation (intended to be used internally).
Object(IndexMap<String, GuraType>)
Object with its key/value pairs.
Bool(bool)
Boolean values.
String(String)
String values.
Integer(isize)
Integer values.
BigInteger(i128)
Big integer values.
Float(f64)
Float values.
Array(Vec<GuraType>)
List of Gura values.
WsOrNewLine
Spaces or new line characters (intended to be used internally).
BreakParent
Indicates the ending of an object (intended to be used internally).
Implementations§
source§impl GuraType
impl GuraType
sourcepub fn iter(&self) -> Result<Iter<'_, String, GuraType>, &str>
pub fn iter(&self) -> Result<Iter<'_, String, GuraType>, &str>
Gets an iterator over the references to the elements of an object.
Returns an error if the Gura type is not an object
sourcepub fn iter_mut(&mut self) -> Result<IterMut<'_, String, GuraType>, &str>
pub fn iter_mut(&mut self) -> Result<IterMut<'_, String, GuraType>, &str>
Gets an iterator over the elements of an object.
Returns an error if the Gura type is not an object
sourcepub fn contains_key(&self, key: &str) -> bool
pub fn contains_key(&self, key: &str) -> bool
Checks if a specific key is defined in the Gura Object
If the Gura type is not an object it returns false
Trait Implementations§
source§impl PartialEq<&str> for GuraType
impl PartialEq<&str> for GuraType
source§impl PartialEq<GuraType> for &str
impl PartialEq<GuraType> for &str
source§impl PartialEq<GuraType> for String
impl PartialEq<GuraType> for String
source§impl PartialEq<GuraType> for bool
impl PartialEq<GuraType> for bool
source§impl PartialEq<GuraType> for f32
impl PartialEq<GuraType> for f32
source§impl PartialEq<GuraType> for f64
impl PartialEq<GuraType> for f64
source§impl PartialEq<GuraType> for i128
impl PartialEq<GuraType> for i128
source§impl PartialEq<GuraType> for i32
impl PartialEq<GuraType> for i32
source§impl PartialEq<GuraType> for i64
impl PartialEq<GuraType> for i64
source§impl PartialEq<GuraType> for isize
impl PartialEq<GuraType> for isize
source§impl PartialEq<String> for GuraType
impl PartialEq<String> for GuraType
source§impl PartialEq<bool> for GuraType
impl PartialEq<bool> for GuraType
Implements Eq with primitive types