Rust [Daily] 2019-06-06: Bloom.sh - launched a set of (target) platform par Google services

OnceCell - library used to initialize global variables

Before we have been using lazy_static! This library to initialize global variables and macros, now do not need a macro. Directly OnceCell can, like this:

use std::{env, io};
use once_cell::sync::OnceCell;

#[derive(Debug)]pub struct Logger {
    // ...
}
static INSTANCE: OnceCell<Logger> = OnceCell::new();

impl Logger {
    pub fn global() -> &'static Logger {
        INSTANCE.get().expect("logger is not initialized")
    }

    fn from_cli(args: env::Args) -> Result<Logger, std::io::Error> {
       // ...
#      Ok(Logger {})
    }
}

fn main() {
    let logger = Logger::from_cli(env::args()).unwrap();
    INSTANCE.set(logger).unwrap();
    // use `Logger::global()` from now on
}

Global variables this stuff, sometimes it is useful and convenient for the initialization and read only once, no problem.

Repo

Bloom.sh - introduced a set (goal is) platform par Google services

Site here bloom.sh . Of great ambition ah. Cloud platform, serverless, store, download, notes, contacts, games, music, pictures. . .

There is so much ability? Unknown author's background.

The entire platform is supported by Rust language. Before the line on the site, the author has been rewritten twice, and that is now the third time this edition Rust realized. The first implementation is written in Js, the write performance is too weak, can not stand. Then authors by Google's competitor in the market are encouraging, with the go write a second edition, the speed is to go up, but the authors think go too weak. In many places, to write, difficult to use, difficult to expand. Then the third time, he tried Rust, Rust found that he too loves the. In addition to compilation time is too long (CI / CD and other resource-consuming larger), the other really can not find too many shortcomings.

Construction of such a large system, Rust was so easy to do.

img

Read More
Read More 2
Repo

Bzip2 to be rewritten Rust

A few days ago the news reported, is now officially reported by foreign news websites. It looks like a small thing, bzip2 Linux environment is fairly basic facilities, so the meaning is still quite significant.

Read More

Ferrous systems company made stable release Sealed Rust Rust to establish a higher level (sealed Rust)

This version of Rust (and its associated libraries ecology) Code, property requirements more stringent, dedicated to security-sensitive areas. For example, automotive electronics, industrial equipment, robotics, medical equipment, avionics, and other fields. This is a series of articles, the first to see below.

Read More

Use Rust as data structures and algorithms tutorial book to be published

img

Source library

Rust in block chain

Rust in the block chain more and more, here to do a summary, month more. In addition, rustforce.net also relevant summary on.

Read More

CPython UUID of the package of Rust - fastuuid.

Python to use.

Repo

kube-rs - k8s of Rust client

Today, we are given an article of introduction. Read More

Repo


From Daily Group @Mike

Daily subscription address:

Independent daily subscription address:

Community learning platform subscription:

Guess you like

Origin blog.csdn.net/u012067469/article/details/91050192