feat: add error handling during filter composition and new filter conditions for text matching

This commit is contained in:
2025-10-19 11:08:22 +02:00
parent 2e42afbb04
commit 9af3cb27c2
3 changed files with 7 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ pub fn run(filter: &Filter) -> Result<String, FailedTo> {
(Comparison::Equal, Condition::Bool(_)) => {
compose_fragment(name, "value_bool", "=", i + 1)
}
(_, Condition::Bool(_)) => return Err(FailedTo::ComposeFilter),
// SIGNED INT
(Comparison::Equal, Condition::SignedInt(_)) => {
compose_fragment(name, "value_int", "=", i + 1)

View File

@@ -5,4 +5,8 @@ pub enum E {
GreaterOrEqual,
Lesser,
LesserOrEqual,
IsExactly,
StartsWith,
EndsWith,
Contains,
}

View File

@@ -3,6 +3,8 @@ use crate::*;
/// Represents the possible failures that can occur in the library.
#[derive(Debug, PartialEq, PartialOrd, Eq, Ord, Clone, Copy, Hash)]
pub enum FailedTo {
/// Failed to compose filter statement
ComposeFilter,
/// Failed to convert from Entity to type.
ConvertEntity,
/// Failed to convert from type to Entity.