Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement .write() on Store/ArcStore #2936

Open
gbj opened this issue Sep 6, 2024 · 1 comment
Open

Implement .write() on Store/ArcStore #2936

gbj opened this issue Sep 6, 2024 · 1 comment

Comments

@gbj
Copy link
Collaborator

gbj commented Sep 6, 2024

No description provided.

@brofrain
Copy link
Contributor

brofrain commented Sep 7, 2024

@gbj
I was trying to implement this via brainlessly copy-pasting code from Subfield. It worked well for Field, but ArcStore and Store don't seem to trigger effects.

impl<T> Writeable for ArcStore<T>
where
    T: 'static,
{
    type Value = T;

    fn try_write(&self) -> Option<impl UntrackableGuard<Target = Self::Value>> {
        self.writer()
    }

    fn try_write_untracked(
        &self,
    ) -> Option<impl DerefMut<Target = Self::Value>> {
        self.writer().map(|mut writer| {
            writer.untrack();
            writer
        })
    }
}

I haven't been able to pinpoint where the problem lies exactly, but I suspect that self.writer() being untracked isn't the intended behavior?
I need a little help with this 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants