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.)
Unresolved Questions
Feature gate:
#![feature(smart_pointer_try_map)]This is a tracking issue for
mapandtry_mapfunctions for various smart pointer types, as per rust-lang/libs-team#364Public API
Steps / History
(Remember to update the
S-tracking-*label when checking boxes.)Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩