diff --git a/lib/src/fnc/script/classes/duration.rs b/lib/src/fnc/script/classes/duration.rs index 1cee421b..4a96b849 100644 --- a/lib/src/fnc/script/classes/duration.rs +++ b/lib/src/fnc/script/classes/duration.rs @@ -26,6 +26,10 @@ pub mod duration { pub fn value(&self) -> &str { &self.value } + // Compare two Duration instances + pub fn is(a: &Duration, b: &Duration, args: Rest) -> bool { + a.value == b.value + } /// Convert the object to a string pub fn toString(&self, args: Rest) -> String { self.value.to_owned() diff --git a/lib/src/fnc/script/classes/record.rs b/lib/src/fnc/script/classes/record.rs index ac96305e..b0a16f40 100644 --- a/lib/src/fnc/script/classes/record.rs +++ b/lib/src/fnc/script/classes/record.rs @@ -33,6 +33,10 @@ pub mod record { pub fn id(&self) -> &str { &self.id } + // Compare two Record instances + pub fn is(a: &Record, b: &Record, args: Rest) -> bool { + a.tb == b.tb && a.id == b.id + } /// Convert the object to a string pub fn toString(&self, args: Rest) -> String { format!("{}:{}", self.tb, self.id) diff --git a/lib/src/fnc/script/classes/uuid.rs b/lib/src/fnc/script/classes/uuid.rs index 6dd90802..849b9c60 100644 --- a/lib/src/fnc/script/classes/uuid.rs +++ b/lib/src/fnc/script/classes/uuid.rs @@ -26,6 +26,10 @@ pub mod uuid { pub fn value(&self) -> &str { &self.value } + // Compare two Uuid instances + pub fn is(a: &Uuid, b: &Uuid, args: Rest) -> bool { + a.value == b.value + } /// Convert the object to a string pub fn toString(&self, args: Rest) -> String { self.value.to_owned()