pub enum DataType {
Id(Uuid),
Text(String),
Number(f32),
Boolean(bool),
Array(Vec<DataType>),
Document(HashMap<String, DataType>),
}Variants§
Id(Uuid)
Text(String)
Number(f32)
Boolean(bool)
Array(Vec<DataType>)
Document(HashMap<String, DataType>)
Implementations§
Source§impl DataType
impl DataType
pub fn get_type(&self) -> &str
pub fn get(&self, index: &str) -> Option<&DataType>
pub fn get_mut(&mut self, index: &str) -> Option<&mut DataType>
pub fn find( &self, sub_key: &str, op: FindOp, value: DataType, ) -> Option<DataType>
pub fn set( &mut self, index: &str, dt: DataType, ) -> Result<DataType, &'static str>
pub fn remove(&mut self, index: &str) -> Result<DataType, &'static str>
pub fn to_id(&self) -> Uuid
pub fn to_text(&self) -> &String
pub fn to_number(&self) -> f32
pub fn to_boolean(&self) -> bool
pub fn to_array(&self) -> &Vec<DataType>
pub fn to_document(&self) -> &HashMap<String, DataType>
pub fn infer_type(raw: &str) -> u16
pub fn load(t: u16, raw: String) -> Option<Self>
Trait Implementations§
impl StructuralPartialEq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
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