pub fn new(url: String) -> Rc<Worker> {
        // TODO is url needed? Init is done later...
        // User hash and masterkey are not known at initialization
        let user = RefCell::new(None);
        let mkey = RefCell::new(None);
        // Databases will be setup later on
        let meta = RefCell::new(None);
        let private = RefCell::new(None);
        // Create worker with reference counting to enable its usage
        // in multiple parts in the application
        let worker = Rc::new(Worker {
            user,
            mkey,
            meta,
            private,
            closures: RefCell::new(None),
            service_status: RefCell::new(String::from("offline")),
            service_closure: RefCell::new(None),
            database_url: RefCell::new(None),
            category_cache: RefCell::new(HashMap::new()),
            category_clear: RefCell::new(HashMap::new()),
            password_cache: RefCell::new(HashMap::new()),
            password_clear: RefCell::new(HashMap::new()),
        });
        // Return reference counted worker
        worker
    }
/// Creates a new Worker that manages databases.
/// This includes live syncing and methods for CRUD-operations.
Creates a new Worker that manages databases.
This includes live syncing and methods for CRUD-operations.
Creates a new Worker that manages databases . This includes live syncing and methods for CRUD - operations .
pub fn new(url: String) -> Rc<Worker> {
        // TODO is url needed? Init is done later...
        // User hash and masterkey are not known at initialization
        let user = RefCell::new(None);
        let mkey = RefCell::new(None);
        // Databases will be setup later on
        let meta = RefCell::new(None);
        let private = RefCell::new(None);
        // Create worker with reference counting to enable its usage
        // in multiple parts in the application
        let worker = Rc::new(Worker {
            user,
            mkey,
            meta,
            private,
            closures: RefCell::new(None),
            service_status: RefCell::new(String::from("offline")),
            service_closure: RefCell::new(None),
            database_url: RefCell::new(None),
            category_cache: RefCell::new(HashMap::new()),
            category_clear: RefCell::new(HashMap::new()),
            password_cache: RefCell::new(HashMap::new()),
            password_clear: RefCell::new(HashMap::new()),
        });
        // Return reference counted worker
        worker
    }
pub fn new ( url : String ) -> Rc < Worker > { // TODO is url needed? Init is done later... // User hash and masterkey are not known at initialization let user = RefCell :: new ( None ) ; let mkey = RefCell :: new ( None ) ; // Databases will be setup later on let meta = RefCell :: new ( None ) ; let private = RefCell :: new ( None ) ; // Create worker with reference counting to enable its usage // in multiple parts in the application let worker = Rc :: new ( Worker { user , mkey , meta , private , closures : RefCell :: new ( None ) , service_status : RefCell :: new ( String :: from ( " " ) ) , service_closure : RefCell :: new ( None ) , database_url : RefCell :: new ( None ) , category_cache : RefCell :: new ( HashMap :: new ( ) ) , category_clear : RefCell :: new ( HashMap :: new ( ) ) , password_cache : RefCell :: new ( HashMap :: new ( ) ) , password_clear : RefCell :: new ( HashMap :: new ( ) ) , } ) ; // Return reference counted worker worker }
Creates a new Worker that manages databases.
Creates a new Worker that manages databases .
url
String
url
String