Skip to content

Commit d17f95b

Browse files
authored
[capi] Add ZonedDateTime::{equals,offset} (#362)
1 parent 6a8e5f4 commit d17f95b

File tree

4 files changed

+48
-0
lines changed

4 files changed

+48
-0
lines changed

temporal_capi/bindings/c/ZonedDateTime.h

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporal_capi/bindings/cpp/temporal_rs/ZonedDateTime.d.hpp

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporal_capi/bindings/cpp/temporal_rs/ZonedDateTime.hpp

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

temporal_capi/src/zoned_date_time.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,17 @@ pub mod ffi {
200200
self.0.compare_instant(&other.0)
201201
}
202202

203+
pub fn equals(&self, other: &Self) -> bool {
204+
self.0 == other.0
205+
}
206+
207+
pub fn offset(&self, write: &mut DiplomatWrite) -> Result<(), TemporalError> {
208+
let string = self.0.offset()?;
209+
// throw away the error, this should always succeed
210+
let _ = write.write_str(&string);
211+
Ok(())
212+
}
213+
203214
pub fn start_of_day(&self) -> Result<Box<ZonedDateTime>, TemporalError> {
204215
self.0
205216
.start_of_day()

0 commit comments

Comments
 (0)