pub trait Value: DynClone {
Show 43 methods
// Required methods
fn literal(&self) -> String;
fn equals(&self, other: &Box<dyn Value>) -> bool;
fn compare(&self, other: &Box<dyn Value>) -> Option<Ordering>;
fn data_type(&self) -> Box<dyn DataType>;
fn as_any(&self) -> &dyn Any;
// Provided methods
fn add_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn sub_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn mul_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn div_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn rem_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn caret_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn or_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn and_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn xor_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn logical_or_op(
&self,
other: &Box<dyn Value>,
) -> Result<Box<dyn Value>, String> { ... }
fn logical_and_op(
&self,
other: &Box<dyn Value>,
) -> Result<Box<dyn Value>, String> { ... }
fn logical_xor_op(
&self,
other: &Box<dyn Value>,
) -> Result<Box<dyn Value>, String> { ... }
fn shl_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn shr_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn index_op(&self, index: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn slice_op(
&self,
start: &Option<Box<dyn Value>>,
end: &Option<Box<dyn Value>>,
) -> Result<Box<dyn Value>, String> { ... }
fn eq_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn group_eq_op(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
) -> Result<Box<dyn Value>, String> { ... }
fn bang_eq_op(
&self,
other: &Box<dyn Value>,
) -> Result<Box<dyn Value>, String> { ... }
fn group_bang_eq_op(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
) -> Result<Box<dyn Value>, String> { ... }
fn null_safe_eq_op(
&self,
other: &Box<dyn Value>,
) -> Result<Box<dyn Value>, String> { ... }
fn group_null_safe_eq_op(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
) -> Result<Box<dyn Value>, String> { ... }
fn gt_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn group_gt_op(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
) -> Result<Box<dyn Value>, String> { ... }
fn gte_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn group_gte_op(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
) -> Result<Box<dyn Value>, String> { ... }
fn lt_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn group_lt_op(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
) -> Result<Box<dyn Value>, String> { ... }
fn lte_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn group_lte_op(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
) -> Result<Box<dyn Value>, String> { ... }
fn not_op(&self) -> Result<Box<dyn Value>, String> { ... }
fn neg_op(&self) -> Result<Box<dyn Value>, String> { ... }
fn bang_op(&self) -> Result<Box<dyn Value>, String> { ... }
fn contains_op(
&self,
other: &Box<dyn Value>,
) -> Result<Box<dyn Value>, String> { ... }
fn like_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn glob_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { ... }
fn regexp_op(
&self,
other: &Box<dyn Value>,
) -> Result<Box<dyn Value>, String> { ... }
fn cast_op(
&self,
target_type: &Box<dyn DataType>,
) -> Result<Box<dyn Value>, String> { ... }
}
Expand description
The in memory representation of the Values in the GitQL query engine
Required Methods§
Sourcefn equals(&self, other: &Box<dyn Value>) -> bool
fn equals(&self, other: &Box<dyn Value>) -> bool
Return if other Value
is equal or not to current value
Provided Methods§
Sourcefn slice_op(
&self,
start: &Option<Box<dyn Value>>,
end: &Option<Box<dyn Value>>,
) -> Result<Box<dyn Value>, String>
fn slice_op( &self, start: &Option<Box<dyn Value>>, end: &Option<Box<dyn Value>>, ) -> Result<Box<dyn Value>, String>
Sourcefn group_eq_op(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
) -> Result<Box<dyn Value>, String>
fn group_eq_op( &self, other: &Box<dyn Value>, group_op: &GroupComparisonOperator, ) -> Result<Box<dyn Value>, String>
Sourcefn group_bang_eq_op(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
) -> Result<Box<dyn Value>, String>
fn group_bang_eq_op( &self, other: &Box<dyn Value>, group_op: &GroupComparisonOperator, ) -> Result<Box<dyn Value>, String>
Sourcefn group_null_safe_eq_op(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
) -> Result<Box<dyn Value>, String>
fn group_null_safe_eq_op( &self, other: &Box<dyn Value>, group_op: &GroupComparisonOperator, ) -> Result<Box<dyn Value>, String>
Sourcefn group_gt_op(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
) -> Result<Box<dyn Value>, String>
fn group_gt_op( &self, other: &Box<dyn Value>, group_op: &GroupComparisonOperator, ) -> Result<Box<dyn Value>, String>
Sourcefn group_gte_op(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
) -> Result<Box<dyn Value>, String>
fn group_gte_op( &self, other: &Box<dyn Value>, group_op: &GroupComparisonOperator, ) -> Result<Box<dyn Value>, String>
Sourcefn group_lt_op(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
) -> Result<Box<dyn Value>, String>
fn group_lt_op( &self, other: &Box<dyn Value>, group_op: &GroupComparisonOperator, ) -> Result<Box<dyn Value>, String>
Sourcefn group_lte_op(
&self,
other: &Box<dyn Value>,
group_op: &GroupComparisonOperator,
) -> Result<Box<dyn Value>, String>
fn group_lte_op( &self, other: &Box<dyn Value>, group_op: &GroupComparisonOperator, ) -> Result<Box<dyn Value>, String>
Implementations§
Source§impl dyn Value
impl dyn Value
Sourcepub fn is_float(&self) -> bool
pub fn is_float(&self) -> bool
Return true if this value is FloatValue
Sourcepub fn as_float(&self) -> Option<f64>
pub fn as_float(&self) -> Option<f64>
Return List of f64
represent the inner value of FloatValue
or None if this type it’s called from wrong Value
Sourcepub fn is_number(&self) -> bool
pub fn is_number(&self) -> bool
Return true if this value is IntValue
or FloatValue
Sourcepub fn is_date_time(&self) -> bool
pub fn is_date_time(&self) -> bool
Return true if this value is DateTimeValue
Sourcepub fn as_date_time(&self) -> Option<i64>
pub fn as_date_time(&self) -> Option<i64>
Return List of i64
represent the value of DateTimeValue
or None if this type it’s called from wrong Value
Sourcepub fn is_interval(&self) -> bool
pub fn is_interval(&self) -> bool
Return true if this value is IntervalValue
Sourcepub fn as_interval(&self) -> Option<Interval>
pub fn as_interval(&self) -> Option<Interval>
Return List of Interval
represent the value of IntervalValue
or None if this type it’s called from wrong Value
Sourcepub fn is_array(&self) -> bool
pub fn is_array(&self) -> bool
Return true if this value is ArrayValue
Sourcepub fn is_array_of(&self, condition: fn(&Box<dyn DataType>) -> bool) -> bool
pub fn is_array_of(&self, condition: fn(&Box<dyn DataType>) -> bool) -> bool
Return true if this value is ArrayValue
and element type match condition
Sourcepub fn as_array(&self) -> Option<Vec<Box<dyn Value>>>
pub fn as_array(&self) -> Option<Vec<Box<dyn Value>>>
Return List of Value
represent the inner values of ArrayValue
or None if this type it’s called from wrong Value
Sourcepub fn is_range(&self) -> bool
pub fn is_range(&self) -> bool
Return true if this value is RangeValue
Sourcepub fn as_range(&self) -> Option<(Box<dyn Value>, Box<dyn Value>)>
pub fn as_range(&self) -> Option<(Box<dyn Value>, Box<dyn Value>)>
Return Tuple of two Value
represent the start and the end of RangeValue
or None if this type it’s called from wrong Value
Sourcepub fn is_composite(&self) -> bool
pub fn is_composite(&self) -> bool
Return true if this value is CompositeValue