FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    SignedDuration

    struct · ferroui-base · v0.5.0

    struct SignedDuration
    

    A signed time interval with a resolution of 100 nanoseconds.

    View source

    Members

    TICKS_PER_MILLISECOND

    const TICKS_PER_MILLISECOND: i64
    

    The number of ticks in one millisecond.

    Source

    TICKS_PER_SECOND

    const TICKS_PER_SECOND: i64
    

    The number of ticks in one second.

    Source

    TICKS_PER_MINUTE

    const TICKS_PER_MINUTE: i64
    

    The number of ticks in one minute.

    Source

    TICKS_PER_HOUR

    const TICKS_PER_HOUR: i64
    

    The number of ticks in one hour.

    Source

    TICKS_PER_DAY

    const TICKS_PER_DAY: i64
    

    The number of ticks in one day.

    Source

    ZERO

    const ZERO: SignedDuration
    

    The zero interval.

    Source

    MAX_VALUE

    const MAX_VALUE: SignedDuration
    

    The largest interval.

    Source

    MIN_VALUE

    const MIN_VALUE: SignedDuration
    

    The smallest (most negative) interval.

    Source

    from_ticks

    const fn from_ticks(ticks: i64) -> Self
    

    Creates an interval from a number of 100-nanosecond ticks.

    Source

    from_seconds

    fn from_seconds(value: f64) -> Self
    

    Creates an interval from a number of seconds, rounded to the nearest tick. Panics if the value is not a number or out of range.

    Source

    from_milliseconds

    fn from_milliseconds(value: f64) -> Self
    

    Creates an interval from a number of milliseconds, rounded to the nearest tick. Panics if the value is not a number or out of range.

    Source

    from_minutes

    fn from_minutes(value: f64) -> Self
    

    Creates an interval from a number of minutes.

    Source

    ticks

    const fn ticks(self: Self) -> i64
    

    The number of ticks.

    Source

    total_seconds

    fn total_seconds(self: Self) -> f64
    

    The interval in whole and fractional seconds.

    Source

    total_milliseconds

    fn total_milliseconds(self: Self) -> f64
    

    The interval in whole and fractional milliseconds.

    Source

    to_duration

    fn to_duration(self: Self) -> Option<Duration>
    

    The interval as a Duration; None when it is negative.

    Source

    parse

    fn parse(s: &str) -> Result<SignedDuration, FormatError>
    

    Parses an interval in the invariant format [-]{ d | [d.]hh:mm[:ss[.fffffff]] | d:hh:mm:ss[.fffffff] }.

    Source

    from_hms

    fn from_hms(hours: i32, minutes: i32, seconds: i32) -> Self
    

    The interval of the given hours, minutes and seconds (the C# constructor TimeSpan(int, int, int)). Panics on overflow.

    Source

    from_dhms

    fn from_dhms(days: i32, hours: i32, minutes: i32, seconds: i32) -> Self
    

    The interval of the given days, hours, minutes and seconds (the C# constructor TimeSpan(int, int, int, int)). Panics on overflow.

    Source

    from_dhms_milliseconds

    fn from_dhms_milliseconds(days: i32, hours: i32, minutes: i32, seconds: i32, milliseconds: i32) -> Self
    

    The interval of the given days, hours, minutes, seconds and milliseconds (the C# constructor TimeSpan(int, int, int, int, int)). Panics on overflow.

    Source

    from_hours

    fn from_hours(value: f64) -> Self
    

    Creates an interval from a number of hours.

    Source

    from_days

    fn from_days(value: f64) -> Self
    

    Creates an interval from a number of days.

    Source

    days

    const fn days(self: Self) -> i32
    

    The whole days of the interval (negative for a negative interval).

    Source

    hours

    const fn hours(self: Self) -> i32
    

    The hours component, -23..=23.

    Source

    minutes

    const fn minutes(self: Self) -> i32
    

    The minutes component, -59..=59.

    Source

    seconds

    const fn seconds(self: Self) -> i32
    

    The seconds component, -59..=59.

    Source

    milliseconds

    const fn milliseconds(self: Self) -> i32
    

    The milliseconds component, -999..=999.

    Source

    total_days

    fn total_days(self: Self) -> f64
    

    The interval in whole and fractional days.

    Source

    total_hours

    fn total_hours(self: Self) -> f64
    

    The interval in whole and fractional hours.

    Source

    total_minutes

    fn total_minutes(self: Self) -> f64
    

    The interval in whole and fractional minutes.

    Source

    duration

    fn duration(self: Self) -> SignedDuration
    

    The absolute value of the interval. Panics for TimeSpan::MIN_VALUE.

    Source

    to_string_format

    fn to_string_format(self: Self, format: &str) -> String
    

    Formats with a standard (c, t, T, g, G) or custom .NET TimeSpan format string; an empty format is c. Panics when the format string is invalid (.NET throws FormatException).

    The g and G formats always use . as the decimal separator; .NET uses the one of the culture.

    Source

    try_to_string_format

    fn try_to_string_format(self: Self, format: &str) -> Result<String, FormatError>
    

    Like to_string_format, but gives the error of an invalid format string.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ResourceKeyObject
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • ErasedDestructor
    • IntoEither
    • IObservable<SignedDuration>
    • Clone
    • Copy
    • Debug
    • Default
    • StructuralPartialEq
    • PartialEq
    • Eq
    • PartialOrd
    • Ord
    • Hash
    • From<Duration>
    • TryFrom<SignedDuration>
    • FromStr
    • Display
    • Add
    • Sub
    • AddAssign
    • SubAssign
    • Neg
    • Mul<f64>
    • Add<SignedDuration>
    • Sub<SignedDuration>
    • AddAssign<SignedDuration>
    • SubAssign<SignedDuration>
    • MarkupTyped
    • ValueTypeRegistration

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.