Skip to content

Tracking Issue for error_generic_member_access#99301

@yaahc

Description

@yaahc

Feature gate: #![feature(error_generic_member_access)]

This is a tracking issue for the generic member access API on the error trait, which generalizes the pattern of fn source(&self) -> Option<&dyn Error> and fn backtrace(&self) -> Option<&Backtrace> into fn request_ref::<T>(&self) -> Option<&T>

Public API

// std::errorpubtraitError:Debug + Display{// existing API unchangedfnprovide<'a>(&'aself,req:&mutRequest<'a>){}}pubstructRequest<'a>{ .. }impl<'a>Request<'a>{pubfnprovide_value<T>(&mutself,value:T) -> &mutRequest<'a>whereT:'static;pubfnprovide_value_with<T>(&mutself,fulfil:implFnOnce() -> T,) -> &mutRequest<'a>whereT:'static;pubfnprovide_ref<T>(&mutself,value:&'aT) -> &mutRequest<'a>whereT:'static + ?Sized;pubfnprovide_ref_with<T>(&mutself,fulfil:implFnOnce() -> &'aT,) -> &mutRequest<'a>whereT:'static + ?Sized;pubfnwould_be_satisfied_by_value_of<T>(&self) -> boolwhereT:'static;pubfnwould_be_satisfied_by_ref_of<T>(&self) -> boolwhereT:'static + ?Sized;}pubfnrequest_ref<'a,T: ?Sized + 'static>(err:&'a(implError + ?Sized)) -> Option<&'aT>;pubfnrequest_value<T:'static>(err:&(implError + ?Sized)) -> Option<T>;

Steps / History

Now tracked by @waynr in #99301 (comment)

Unresolved Questions

  • None yet.

Metadata

Metadata

Assignees

Labels

C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions