total
Returns the total value of the duration in the specified unit.
Parameters
- self:Duration
- Duration
- options:TotalOptions
- TotalOptions
Source
Implementation
pub fn total(self: Duration, options: TotalOptions) !f64 {
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_total(self._inner, abi.to.unit(options.unit).?, rel);
return try abi.extractResult(res);
}