Head's Up: I'm in the middle of upgrading my site. Most things are in place, but there are something missing and/or broken including image alt text. Please bear with me while I'm getting things fixed.

Use And Change Mutex Value In A Rust Struct Object

I'm still new to rust. There might be different/better ways to do this, but this is working for me for a cache

use std::sync::Mutex;

pub struct Widget {
    pub holder: Mutex<u8>,

impl Widget {
    pub fn new(holder: Mutex<u8>) -> Widget {
        Widget { holder }
    pub fn move_it(&self) {
        let mut pinger = self.holder.lock().unwrap();
        *pinger = 7;

fn main() {
    let holder = Mutex::new(5);
    let w = Widget { holder };
    println!("m = {:?}", w.holder);
    println!("m = {:?}", w.holder);
results start