The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.
- Image from https://www.archlinux.org/
| #[derive(Debug, PartialEq)] | |
| enum State { | |
| Waiting { waiting_time: usize }, | |
| Filling { rate: usize }, | |
| Done, | |
| Failure(String), | |
| } | |
| #[derive(Debug, Clone, Copy)] | |
| enum Event { |
| macro_rules! fmt_args { | |
| ($($tt:tt)*) => { | |
| _fmt_args_!("",; $($tt)*) | |
| }; | |
| } | |
| macro_rules! _fmt_args_ { | |
| ($fmt:expr, $($args:expr,)*; ) => { | |
| format_args!($fmt $(,$args)*) | |
| }; |
| #[macro_export] | |
| macro_rules! info { | |
| // info!("...") | |
| ($e:expr) => { | |
| $crate::info_impl!(($e)); | |
| }; | |
| // info!("...", args...) | |
| ($e:expr, $($rest:tt)*) => { | |
| $crate::info_impl!(($e) $($rest)*); |
| name: Rust | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| name: ${{ matrix.rust }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: |
| #[cli] | |
| struct Args { | |
| /// The language of the text. | |
| #[cli(header = "Content-Language")] | |
| lang: String, | |
| /// The current page's description. | |
| #[cli(dom = "head.description")] | |
| desc: String, | |
| } |
| // +-----------------------+ | |
| // | futures + async/await | --+ | |
| // +-----------------------+ +-- Application | |
| // | runtime | --+ | |
| // +-----------------------+ | |
| // | OS | --+ | |
| // +-----------------------+ +-- Platform | |
| // | Hardware | --+ | |
| // +-----------------------+ |
| trait AsyncRead { | |
| async fn read(&self, buf: &mut [u8]) -> io::Result<usize>; | |
| } | |
| fn main () { | |
| let mut buf = vec![0; 1024]; | |
| let bytes_read = read(&mut buf).await?; | |
| dbg!(buf); | |
| } |
| #![feature(async_await)] | |
| use std::{cell::Cell, future::Future, io, net::SocketAddr, pin::Pin}; | |
| pub trait TcpStream {} | |
| impl<T: TcpStream + ?Sized> TcpStream for Pin<Box<T>> {} | |
| pub trait Runtime: Send + Sync + 'static { | |
| type TcpStream: TcpStream; |
| #![feature(async_await)] | |
| use std::{cell::Cell, future::Future, io, net::SocketAddr, pin::Pin}; | |
| pub trait TcpStream {} | |
| impl<T: TcpStream + ?Sized> TcpStream for Pin<Box<T>> {} | |
| pub trait Runtime: Send + Sync + 'static { | |
| type TcpStream: TcpStream; |
The official installation guide (https://wiki.archlinux.org/index.php/Installation_Guide) contains a more verbose description.