Learning Rust
Getting Started + Installation | Cheat Sheet
AC585fa75f9942daaaaaacaa8aadaaaaaa | |
00000000000000000000000000000000 |
import timeit | |
# root_object = { | |
# "artifacts": { | |
# "event": { | |
# "details": { | |
# "firstname": "Sterling", | |
# "middlename": "Malory", | |
# "lastname": "Archer", | |
# "vault_test" : "vault:socless_vault_tests.txt" |
/// ``` | |
/// use ex01::list_of_plastic; | |
/// | |
/// assert_eq!(list_of_plastic("Polyethylene Terephthalate"), Some("Polyethylene Terephthalate")); | |
/// assert_eq!(list_of_plastic("not a plastic"), None); | |
/// assert_eq!(list_of_plastic("Polyvinyl Chloride"), Some("Polyvinyl Chloride")); | |
/// ``` | |
pub fn list_of_plastic(plastic: &str) -> Option<&str> { |
My Awesome Sketch | |
First State | |
some event -> Second State | |
Second State | |
some event -> Third State | |
Third State |
///```rust | |
/// use ex00::born_to_be_alive; | |
/// let thread = born_to_be_alive(); | |
/// let _ = thread.join(); | |
/// | |
/// ``` | |
pub fn born_to_be_alive() -> JoinHandle<()> { |
from result import as_result | |
import requests | |
def test_as_result_3rd_party_fn() -> None: | |
""" | |
The ``as_result()`` is a signature-preserving decorator. | |
""" | |
request_nt = as_result(BaseException)(requests.request) |