Add stubs for the math functions.

This commit is contained in:
Tom Alexander 2020-06-13 22:12:00 -04:00
parent 2c5c2d239c
commit d8b8c223f0
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 63 additions and 0 deletions

View File

@ -439,6 +439,34 @@ impl CompareContextElement for serde_json::Value {
.map(IceResult::from_owned),
}
}
fn math_subtract<'a>(&self, other: &dyn ContextElement) -> Option<IceResult<'a>> {
todo!()
}
fn math_multiply<'a>(&self, other: &dyn ContextElement) -> Option<IceResult<'a>> {
todo!()
}
fn math_divide<'a>(&self, other: &dyn ContextElement) -> Option<IceResult<'a>> {
todo!()
}
fn math_modulus<'a>(&self, other: &dyn ContextElement) -> Option<IceResult<'a>> {
todo!()
}
fn math_abs<'a>(&self) -> Option<IceResult<'a>> {
todo!()
}
fn math_floor<'a>(&self) -> Option<IceResult<'a>> {
todo!()
}
fn math_ceil<'a>(&self) -> Option<IceResult<'a>> {
todo!()
}
}
#[derive(Debug)]

View File

@ -69,6 +69,13 @@ pub trait CompareContextElement: CastToAny {
fn partial_compare(&self, other: &dyn ContextElement) -> Option<Ordering>;
fn math_add<'a>(&self, other: &dyn ContextElement) -> Option<IceResult<'a>>;
fn math_subtract<'a>(&self, other: &dyn ContextElement) -> Option<IceResult<'a>>;
fn math_multiply<'a>(&self, other: &dyn ContextElement) -> Option<IceResult<'a>>;
fn math_divide<'a>(&self, other: &dyn ContextElement) -> Option<IceResult<'a>>;
fn math_modulus<'a>(&self, other: &dyn ContextElement) -> Option<IceResult<'a>>;
fn math_abs<'a>(&self) -> Option<IceResult<'a>>;
fn math_floor<'a>(&self) -> Option<IceResult<'a>>;
fn math_ceil<'a>(&self) -> Option<IceResult<'a>>;
}
impl<C: 'static + ContextElement> CastToAny for C {

View File

@ -373,4 +373,32 @@ impl CompareContextElement for OwnedLiteral {
},
}
}
fn math_subtract<'a>(&self, other: &dyn ContextElement) -> Option<IceResult<'a>> {
todo!()
}
fn math_multiply<'a>(&self, other: &dyn ContextElement) -> Option<IceResult<'a>> {
todo!()
}
fn math_divide<'a>(&self, other: &dyn ContextElement) -> Option<IceResult<'a>> {
todo!()
}
fn math_modulus<'a>(&self, other: &dyn ContextElement) -> Option<IceResult<'a>> {
todo!()
}
fn math_abs<'a>(&self) -> Option<IceResult<'a>> {
todo!()
}
fn math_floor<'a>(&self) -> Option<IceResult<'a>> {
todo!()
}
fn math_ceil<'a>(&self) -> Option<IceResult<'a>> {
todo!()
}
}