Skip to content

Tracking Issue for lazy_get #129333

Open
Tracking Issue
@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.proposed-final-comment-periodProposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions