use std::sync::Arc; pub struct Browser { connection: Arc, } impl Browser { fn init(&self) {} fn save(&self) {} fn restore(&self) {} } pub fn new(connection: Arc) -> Browser { let this = Browser { connection }; this.init(); this }