Skip to content

Implement CandidType for std::time::SystemTime #129

@osa1

Description

@osa1

serde serializes SystemTime as Duration from std::time::UNIX_EPOCH. Having a CandidType implementation for it that does the same would be useful when sending SystemTime in a message.

I actually tried to implement this myself but failed because I don't understand how to generate named fields in candid. The serde implementation for SystemTime wants a record with secs_since_epoch and nanos_since_epoch fields, for the second and nanosecond parts, respectively. I don't know if that's possible to do in candid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions