pub enum Value {
Number(isize),
Text(String),
}Expand description
Basic component of virtual data
Value can be either number or text.
- “Number” is a signed interger (isize)
- Text is simply any data
Dcsv doesn’t support float type because float can change the “original” source while overriding. Since dcsv’s goal is about safe manipulation of csv value, float is not appropriate.
Variants§
Implementations§
source§impl Value
impl Value
sourcepub fn get_type(&self) -> ValueType
pub fn get_type(&self) -> ValueType
Get a type of value
This returns a new variable “ValueType”
sourcepub fn from_str(src: &str, value_type: ValueType) -> DcsvResult<Self>
pub fn from_str(src: &str, value_type: ValueType) -> DcsvResult<Self>
Convert string into value with given type
This can fail when a given source cannot bed converted to isize
Trait Implementations§
source§impl PartialEq for Value
impl PartialEq for Value
source§impl PartialOrd for Value
impl PartialOrd for Value
1.0.0 · source§fn 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 moreimpl Eq for Value
impl StructuralEq 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§
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