-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(smart_pointer_try_map)]
This is a tracking issue for map
and try_map
functions for various smart pointer types, as per rust-lang/libs-team#364
Public API
// Taking T by value
impl Box<T> {
fn map<U>(this: Self, f: impl FnOnce(T) -> U) -> Box<U>;
fn try_map<R>(this: Self, f: impl FnOnce(T) -> R) -> ChangeOutputType<R, Box<R::Output>>
where
R: Try,
R::Residual: Residual<Box<R::Output, A>>;
}
impl UniqueRc<T> {
fn map<U>(this: Self, f: impl FnOnce(T) -> U) -> UniqueRc<U>;
fn try_map<R>(this: Self, f: impl FnOnce(T) -> R) -> ChangeOutputType<R, UniqueRc<R::Output>>
where
R: Try,
R::Residual: Residual<UniqueRc<R::Output, A>>;
}
impl UniqueArc<T> {
fn map<U>(this: Self, f: impl FnOnce(T) -> U) -> UniqueArc<U>;
fn try_map<R>(this: Self, f: impl FnOnce(T) -> R) -> ChangeOutputType<R, UniqueArc<R::Output>>
where
R: Try,
R::Residual: Residual<UniqueArc<R::Output, A>>;
}
// Taking T by reference
impl Rc<T> {
fn map<U>(this: Self, f: impl FnOnce(&T) -> U) -> Rc<U>;
fn try_map<R>(this: Self, f: impl FnOnce(&T) -> R) -> ChangeOutputType<R, Rc<R::Output>>
where
R: Try,
R::Residual: Residual<Rc<R::Output, A>>;
}
impl Arc<T> {
fn map<U>(this: Self, f: impl FnOnce(&T) -> U) -> Arc<<U>;
fn try_map<R>(this: Self, f: impl FnOnce(&T) -> R) -> ChangeOutputType<R, Arc<<R::Output>>
where
R: Try,
R::Residual: Residual<Arc<R::Output, A>>;
}
Steps / History
(Remember to update the S-tracking-*
label when checking boxes.)
- Implementation: WIP WIP: smart pointer (try_)map #144420
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
Footnotes
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.