-
Notifications
You must be signed in to change notification settings - Fork 669
Closed
Description
Currently we have:
pub trait Future { type Output; ... }
pub trait TryFuture { type Item; type Error; ... }pub trait Stream { type Item; ... }
pub trait TryStream { type TryItem; type TryError; ... }TryStream's success associated type cannot be calledItembecauseStreamalready uses that name for its associated type. That's why we end up with the not so great namesTryItemandTryErrorTryFutureandTryStreamhave inconsistently named associated types
Here's what I propose:
pub trait Future { type Output; ... }
pub trait TryFuture { type Ok; type Err; ... }pub trait Stream { type Item; ... }
pub trait TryStream { type Ok; type Err; ... }That way the naming would be consistent with the variants of the Result enum!
Future<Output = Result<T, E>>
TryFuture<Ok = T, Err = E>Stream<Item = Result<T, E>>
TryStream<Ok = T, Err = E>Metadata
Metadata
Assignees
Labels
No labels