compare
Compares two durations, returning -1, 0, or 1 if this duration is shorter, equal, or longer than the other.
Parameters
- self:Duration
- Duration
- other:Duration
- Duration
- options:CompareOptions
- CompareOptions
Source
Implementation
pub fn compare(self: Duration, other: Duration, options: CompareOptions) !i8 {
const rel = if (options.relative_to) |r| abi.to.durRelativeTo(r) else abi.c.RelativeTo{ .date = null, .zoned = null };
const res = abi.c.temporal_rs_Duration_compare(self._inner, other._inner, rel);
return try abi.extractResult(res);
}