-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking Issue for OnceCell/Lock::try_insert() #116693
Copy link
Copy link
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 RFCT-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.
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 RFCT-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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Feature gate:
#![feature(once_cell_try_insert)]This is a tracking issue for
OnceCell::try_insert()andOnceLock::try_insert().This adds a method similarly to
OnceCell/Lock::set()but returns a reference at the same time. This is also similar toOnceCell/Lock::get_or_init()but the return value also tells you if the value was actually inserted or if theOnceCell/Lockwas already occupied.Public API
Steps / History
OnceCell/Lock::try_insert()libs-team#276OnceCell/Lock::try_insert()#116540Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩