-
Notifications
You must be signed in to change notification settings - Fork 594
Open
Labels
API-incompatibleTracking changes that need incompatible API revisionsTracking changes that need incompatible API revisions
Milestone
Description
The TimeZone trait is not bound to Send or Sync, although most (all?) implementations would meet the requirements. This makes it difficult to work with generic DateTime<Tz> in multithreaded environments.
My particular use case is that I have an error enum for a date which might be out of certain bounds. In using the failure crate my errors must be Send + Sync, so this can't be generic over a DateTime<TimeZone> because the TimeZone trait doesn't meet the bounds. I'd either have to convert to a concrete timezone like Utc or use naive time.
#[derive(Debug, failure::Fail)]
pub enum DateOutOfBounds {
#[fail(display = "Date is too early: {}", _0)]
TooEarly(chrono::NaiveDateTime),
#[fail(display = "Date is too late: {}", _0)]
TooLate(chrono::NaiveDateTime),
}mleonhard and Folyd
Metadata
Metadata
Assignees
Labels
API-incompatibleTracking changes that need incompatible API revisionsTracking changes that need incompatible API revisions