pub fn to_epoch_millis(self) -> Result<i64, ConversionError> {
        let subsec_millis =
            Integer::div_floor(&i64::from(self.subsecond_nanos), &(NANOS_PER_MILLI as i64));
        if self.seconds < 0 {
            self.seconds
                .checked_add(1)
                .and_then(|seconds| seconds.checked_mul(MILLIS_PER_SECOND))
                .and_then(|millis| millis.checked_sub(1000 - subsec_millis))
        } else {
            self.seconds
                .checked_mul(MILLIS_PER_SECOND)
                .and_then(|millis| millis.checked_add(subsec_millis))
        }
        .ok_or(ConversionError(
            "Instant value too large to fit into i64 epoch millis",
        ))
    }
/// Converts the `Instant` to the number of milliseconds since the Unix epoch.
/// This is fallible since `Instant` holds more precision than an `i64`, and will
/// return a `ConversionError` for `Instant` values that can't be converted.
Converts the `Instant` to the number of milliseconds since the Unix epoch.
Converts the ` Instant ` to the number of milliseconds since the Unix epoch .
pub fn to_epoch_millis(self) -> Result<i64, ConversionError> {
        let subsec_millis =
            Integer::div_floor(&i64::from(self.subsecond_nanos), &(NANOS_PER_MILLI as i64));
        if self.seconds < 0 {
            self.seconds
                .checked_add(1)
                .and_then(|seconds| seconds.checked_mul(MILLIS_PER_SECOND))
                .and_then(|millis| millis.checked_sub(1000 - subsec_millis))
        } else {
            self.seconds
                .checked_mul(MILLIS_PER_SECOND)
                .and_then(|millis| millis.checked_add(subsec_millis))
        }
        .ok_or(ConversionError(
            "Instant value too large to fit into i64 epoch millis",
        ))
    }
pub fn to_epoch_millis ( self ) -> Result < i64 , ConversionError > { let subsec_millis = Integer :: div_floor ( & i64 :: from ( self . subsecond_nanos ) , & ( NANOS_PER_MILLI as i64 ) ) ; if self . seconds < 0 { self . seconds . checked_add ( 1 ) . and_then ( | seconds | seconds . checked_mul ( MILLIS_PER_SECOND ) ) . and_then ( | millis | millis . checked_sub ( 1000 - subsec_millis ) ) } else { self . seconds . checked_mul ( MILLIS_PER_SECOND ) . and_then ( | millis | millis . checked_add ( subsec_millis ) ) } . ok_or ( ConversionError ( " " , ) ) }
Converts the `Instant` to the number of milliseconds since the Unix epoch.
Converts the ` Instant ` to the number of milliseconds since the Unix epoch .
self
self