temporal icon indicating copy to clipboard operation
temporal copied to clipboard

Add two different HostHook impls

Open nekevss opened this issue 3 months ago • 4 comments

Put together this PR based on some ongoing discussion around the host system returned by Temporal::now().

I think this may be the right direction for this API in temporal_rs. But thought I'd at least put it together for further discussion.

nekevss avatar Sep 25 '25 04:09 nekevss

I think this is a good idea

Manishearth avatar Sep 25 '25 20:09 Manishearth

I mentioned this on Matrix, but just so that it's visible here.

Thoughts on the actual method names?

For instance, in theory this could also be changed to.

struct Temporal;

impl Temporal {
    fn now_with_system_fallback() -> Now<LocalHostSystem> {
        todo!()
    }

    fn now_with_utc_fallback() -> Now<UtcHostSystem> {
        todo!()
    }
}

nekevss avatar Sep 25 '25 21:09 nekevss

This isn't fallback, is it? It's the system Now or the UTC Now?

Manishearth avatar Sep 25 '25 21:09 Manishearth

Hmmmmm, that's true it's more of a host default value.

It's more so that if no TimeZone is provided, then we default / "fall back" to the host time zone. I'm not entirely convinced that that is a fall back, per se. But I think it conveys the behavior of how the Now will do in an explicit manner.

But calling it a fallback, then makes the time_zone method on Now incredibly strange, so we can go with the current names.

nekevss avatar Sep 25 '25 21:09 nekevss