KEMBAR78
Tracking Issue for `lazy_get` · Issue #129333 · rust-lang/rust · GitHub
Skip to content

Tracking Issue for lazy_get #129333

@ChayimFriedman2

Description

@ChayimFriedman2

Feature gate: #![feature(lazy_get)]

This is a tracking issue for LazyCell/Lock::get[_mut](), allowing you to extract a reference from a Lazy only if it is initialized, approved in ACP rust-lang/libs-team#429.

Public API

impl<T, F> core::cell::LazyCell<T, F> {
    pub fn get(this: &Self) -> Option<&T>;
    pub fn get_mut(this: &mut Self) -> Option<&mut T>;
    pub fn force_mut(this: &mut Self) -> &mut T;
}
impl<T, F> std::sync::LazyLock<T, F> {
    pub fn get(this: &Self) -> Option<&T>;
    pub fn get_mut(this: &mut Self) -> Option<&mut T>;
    pub fn force_mut(this: &mut Self) -> &mut T;
}

Steps / History

Unresolved Questions

  • None yet.

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html

Metadata

Metadata

Assignees

No one assigned

    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.final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions