Skip to content

Tracking Issue for Duration::try_from_secs_{f32, f64} #83400

Closed
@mbartlett21

Description

@mbartlett21

Feature gate: #![feature(duration_checked_float)]

This is a tracking issue for checked methods to construct a duration from a floating-point value of seconds without panicking.

Public API

// core::time

impl Duration {
    pub const fn try_from_secs_f32(secs: f32) -> Result<Duration, FromFloatSecsError>;
    pub const fn try_from_secs_f64(secs: f64) -> Result<Duration, FromFloatSecsError>;
}

#[derive(Debug, Clone, PartialEq, Eq)]
pub struct FromFloatSecsError { ... }

impl core::fmt::Display for FromFloatSecsError { ... }
// std::error

impl std::error::Error for FromFloatSecsError { ... }

Steps / History

Unresolved Questions

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions