Enum time::Sign[][src]

#[repr(i8)]
pub enum Sign {
    Positive,
    Negative,
    Zero,
}
👎 Deprecated since 0.2.7:

The only use for this (obtaining the sign of a Duration) can be replaced with Duration::is_{positive|negative|zero}

Expand description

Contains the sign of a value: positive, negative, or zero.

For ease of use, Sign implements Mul and Div on all signed numeric types. Signs can also be multiplied and divided by another Sign, which follows the same rules as real numbers.

Variants

Positive

👎 Deprecated since 0.2.7:

The only use for this (obtaining the sign of a Duration) can be replaced with Duration::is_{positive|negative|zero}

A positive value.

Negative

👎 Deprecated since 0.2.7:

The only use for this (obtaining the sign of a Duration) can be replaced with Duration::is_{positive|negative|zero}

A negative value.

Zero

👎 Deprecated since 0.2.7:

The only use for this (obtaining the sign of a Duration) can be replaced with Duration::is_{positive|negative|zero}

A value that is exactly zero.

Implementations

Return the opposite of the current sign.

assert_eq!(Sign::Positive.negate(), Sign::Negative);
assert_eq!(Sign::Negative.negate(), Sign::Positive);
assert_eq!(Sign::Zero.negate(), Sign::Zero);

Is the sign positive?

assert!(Sign::Positive.is_positive());
assert!(!Sign::Negative.is_positive());
assert!(!Sign::Zero.is_positive());

Is the sign negative?

assert!(!Sign::Positive.is_negative());
assert!(Sign::Negative.is_negative());
assert!(!Sign::Zero.is_negative());

Is the value exactly zero?

assert!(!Sign::Positive.is_zero());
assert!(!Sign::Negative.is_zero());
assert!(Sign::Zero.is_zero());

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Sign defaults to Zero.

assert_eq!(Sign::default(), Sign::Zero);

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Performs the /= operation. Read more

Performs the /= operation. Read more

Performs the /= operation. Read more

Performs the /= operation. Read more

Performs the /= operation. Read more

Performs the /= operation. Read more

Performs the /= operation. Read more

Performs the /= operation. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

Performs the *= operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

The resulting type after applying the ! operator.

Performs the unary ! operation. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.