Skip to content

impl From<timeval> for core::time::Duration #4272

Open
@djc

Description

@djc

For platforms where there is a straightforward mapping, it would be nice to provide this conversion API.

Activity

changed the title [-]impl Into<core::time::Duration> for timeval[/-] [+]impl From<timeval> for core::time::Duration[/+] on Feb 18, 2025
highjeans

highjeans commented on Mar 18, 2025

@highjeans

Currently, every single platform has the timeval struct being two signed integers, while core::time::Duration uses two unsigned integers, so on no platform would the conversion be straighforward (afaik).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @djc@highjeans

        Issue actions

          impl From<timeval> for core::time::Duration · Issue #4272 · rust-lang/libc