├── tftp ├── use_tftp │ ├── test │ ├── hello │ ├── Cargo.toml │ ├── src │ │ └── main.rs │ └── Cargo.lock └── tftp介绍.md ├── tcp ├── client │ ├── .gitignore │ ├── Cargo.lock │ ├── Cargo.toml │ └── src │ │ └── main.rs └── server │ ├── .gitignore │ ├── Cargo.lock │ ├── Cargo.toml │ └── src │ └── main.rs ├── udp ├── client │ ├── .gitignore │ ├── Cargo.lock │ ├── Cargo.toml │ └── src │ │ └── main.rs └── server │ ├── .gitignore │ ├── Cargo.lock │ ├── Cargo.toml │ └── src │ └── main.rs ├── use_build1 ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── build.rs └── src │ └── main.rs ├── use_build2 ├── .gitignore ├── src │ ├── hello.c │ └── main.rs ├── build.rs ├── Cargo.toml └── Cargo.lock ├── use_dns ├── .gitignore ├── Cargo.toml ├── src │ └── main.rs └── Cargo.lock ├── use_ipaddr ├── .gitignore ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── use_ipnet ├── .gitignore ├── Cargo.toml ├── Cargo.lock └── src │ └── main.rs ├── use_mio ├── .gitignore ├── Cargo.toml ├── src │ └── main.rs └── Cargo.lock ├── use_pnet ├── .gitignore ├── Cargo.toml ├── src │ └── main.rs └── Cargo.lock ├── use_serde1 ├── .gitignore ├── Cargo.toml ├── src │ └── main.rs └── Cargo.lock ├── use_socketaddr ├── .gitignore ├── Cargo.lock ├── Cargo.toml └── src │ └── main.rs ├── use_serde2 ├── client │ ├── .gitignore │ ├── Cargo.toml │ ├── src │ │ └── main.rs │ └── Cargo.lock └── server │ ├── .gitignore │ ├── Cargo.toml │ ├── src │ └── main.rs │ └── Cargo.lock ├── use_grpc ├── .gitignore ├── src │ ├── lib.rs │ ├── bin │ │ ├── client.rs │ │ └── server.rs │ ├── foobar_grpc.rs │ └── foobar.rs ├── build.rs ├── Cargo.toml └── foobar.proto ├── .gitattributes ├── ftp ├── use_ftp │ ├── Cargo.toml │ ├── src │ │ └── main.rs │ └── Cargo.lock └── ftp介绍.md ├── use_lettre ├── Cargo.toml ├── src │ └── main.rs └── Cargo.lock └── README.md /tftp/use_tftp/test: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tcp/client/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /tcp/server/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /tftp/use_tftp/hello: -------------------------------------------------------------------------------- 1 | in tt 2 | -------------------------------------------------------------------------------- /udp/client/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /udp/server/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /use_build1/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /use_build2/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /use_dns/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /use_ipaddr/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /use_ipnet/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /use_mio/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /use_pnet/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /use_serde1/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /use_socketaddr/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /use_serde2/client/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /use_serde2/server/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /use_grpc/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.rs linguist-language=Rust 2 | *.toml linguist-language=Rust 3 | -------------------------------------------------------------------------------- /use_build2/src/hello.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void hello() { 4 | printf("Hello, world! \n"); 5 | } -------------------------------------------------------------------------------- /use_build2/build.rs: -------------------------------------------------------------------------------- 1 | extern crate cc; 2 | 3 | fn main() { 4 | cc::Build::new().file("src/hello.c").compile("hello") 5 | } -------------------------------------------------------------------------------- /use_build2/src/main.rs: -------------------------------------------------------------------------------- 1 | extern { fn hello(); } 2 | 3 | fn main() { 4 | unsafe { 5 | hello(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tcp/client/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "client" 5 | version = "0.1.0" 6 | -------------------------------------------------------------------------------- /tcp/server/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "server" 5 | version = "0.1.0" 6 | -------------------------------------------------------------------------------- /udp/client/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "client" 5 | version = "0.1.0" 6 | -------------------------------------------------------------------------------- /udp/server/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "server" 5 | version = "0.1.0" 6 | -------------------------------------------------------------------------------- /use_build1/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "use_build1" 5 | version = "0.1.0" 6 | -------------------------------------------------------------------------------- /use_grpc/src/lib.rs: -------------------------------------------------------------------------------- 1 | // extern crate protobuf; 2 | // extern crate grpc; 3 | // extern crate tls_api; 4 | // extern crate grpc_protobuf; 5 | pub mod foobar; 6 | pub mod foobar_grpc; -------------------------------------------------------------------------------- /use_ipaddr/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "use_ipaddr" 5 | version = "0.1.0" 6 | -------------------------------------------------------------------------------- /use_socketaddr/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "use_socketaddr" 5 | version = "0.1.0" 6 | -------------------------------------------------------------------------------- /use_grpc/build.rs: -------------------------------------------------------------------------------- 1 | extern crate protoc_rust_grpc; 2 | 3 | fn main() { 4 | protoc_rust_grpc::Codegen::new() 5 | .out_dir("src") 6 | .input("foobar.proto") 7 | .rust_protobuf(true) 8 | .run() 9 | .expect("protoc-rust-grpc"); 10 | } -------------------------------------------------------------------------------- /tcp/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "client" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /tcp/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "server" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /udp/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "client" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /udp/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "server" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /use_ipaddr/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "use_ipaddr" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /use_socketaddr/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "use_socketaddr" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | -------------------------------------------------------------------------------- /ftp/use_ftp/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "use_ftp" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | ftp = "3.0.1" 11 | -------------------------------------------------------------------------------- /use_ipnet/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "use_ipnet" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | ipnet = "2.3.0" 11 | -------------------------------------------------------------------------------- /use_pnet/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "use_pnet" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | pnet = "0.26.0" 11 | 12 | -------------------------------------------------------------------------------- /tftp/use_tftp/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "use_tftp" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | tftp_server = "0.0.3" 11 | -------------------------------------------------------------------------------- /use_build1/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "use_build1" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | build = "build.rs" 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [dependencies] 11 | -------------------------------------------------------------------------------- /use_lettre/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "use_lettre" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | lettre = "0.9.3" 11 | lettre_email = "0.9.3" 12 | -------------------------------------------------------------------------------- /use_mio/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "use_mio" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | mio = {version = "0.7.0", features = ["os-poll", "tcp"]} 11 | 12 | -------------------------------------------------------------------------------- /use_dns/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "use_dns" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | trust-dns-resolver = "0.11.0" 11 | trust-dns = "0.16.0" 12 | 13 | 14 | -------------------------------------------------------------------------------- /use_build2/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "use_build2" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | build = "build.rs" 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [dependencies] 11 | 12 | [build-dependencies] 13 | cc = "1.0" 14 | -------------------------------------------------------------------------------- /use_serde2/client/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "client" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | serde = { version = "1.0.106", features = ["derive"] } 11 | serde_json = "1.0" 12 | -------------------------------------------------------------------------------- /use_serde2/server/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "server" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | serde = { version = "1.0.106", features = ["derive"] } 11 | serde_json = "1.0" 12 | -------------------------------------------------------------------------------- /use_serde1/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "use_serde1" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | serde = { version = "1.0.106", features = ["derive"] } 11 | serde_json = "1.0" 12 | serde_yaml = "0.8" 13 | -------------------------------------------------------------------------------- /udp/server/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::net::UdpSocket; 2 | 3 | fn main() -> std::io::Result<()> { 4 | let socket = UdpSocket::bind("127.0.0.1:8080")?; 5 | loop { 6 | let mut buf = [0u8; 1500]; 7 | let (amt, src) = socket.recv_from(&mut buf)?; 8 | println!("size = {}", amt); 9 | 10 | let buf = &mut buf[..amt]; 11 | buf.reverse(); 12 | socket.send_to(buf, src)?; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /use_build2/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "cc" 5 | version = "1.0.52" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "c3d87b23d6a92cd03af510a5ade527033f6aa6fa92161e2d5863a907d4c5e31d" 8 | 9 | [[package]] 10 | name = "use_build2" 11 | version = "0.1.0" 12 | dependencies = [ 13 | "cc", 14 | ] 15 | -------------------------------------------------------------------------------- /use_ipnet/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "ipnet" 5 | version = "2.3.0" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" 8 | 9 | [[package]] 10 | name = "use_ipnet" 11 | version = "0.1.0" 12 | dependencies = [ 13 | "ipnet", 14 | ] 15 | -------------------------------------------------------------------------------- /use_build1/build.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | use std::fs::File; 3 | use std::io::Write; 4 | use std::path::Path; 5 | 6 | fn main() { 7 | let out_dir = env::var("OUT_DIR").unwrap(); 8 | let dest_path = Path::new(&out_dir).join("hello.rs"); 9 | let mut f = File::create(&dest_path).unwrap(); 10 | 11 | f.write_all(b" 12 | fn say_hello() -> &'static str { 13 | \"hello\" 14 | } 15 | ").unwrap(); 16 | } 17 | -------------------------------------------------------------------------------- /use_grpc/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "use_grpc" 3 | version = "0.1.0" 4 | authors = ["anonymousGiga "] 5 | edition = "2018" 6 | 7 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 8 | 9 | [dependencies] 10 | protobuf = "2" 11 | grpc = "0.7.1" 12 | grpc-protobuf = "0.7.1" 13 | futures = "0.3.*" 14 | tls-api = "0.3.*" 15 | 16 | [build-dependencies] 17 | protoc-rust-grpc = "0.7.1" 18 | -------------------------------------------------------------------------------- /use_build1/src/main.rs: -------------------------------------------------------------------------------- 1 | //在实际的项目中,有些包需要编译第三方非Rust代码,例如 C库;有些包需要链接到 C库,当然这些库既可以位于系统上, 也可以从源代码构建。其它的需求则有可能是需要构建代码生成 。 在Cargo中,提供了构建脚本,来满足这些需求。 2 | // 3 | //指定的build命令应执行的Rust文件,将在包编译其它内容之前,被编译和调用,从而具备Rust代码所依赖的构建或生成的组件。Build通常被用来: 4 | // 5 | //构建一个捆绑的C库; 6 | //在主机系统上找到C库; 7 | //生成Rust模块; 8 | //为crate执行所需的某平台特定配置。 9 | // fn say_hello() { 10 | // println!("hello"); 11 | // } 12 | include!(concat!(env!("OUT_DIR"), "/hello.rs")); 13 | 14 | fn main() { 15 | println!("{}", say_hello()); 16 | } 17 | -------------------------------------------------------------------------------- /tftp/use_tftp/src/main.rs: -------------------------------------------------------------------------------- 1 | use tftp_server::server::TftpServerBuilder; 2 | use std::net::{IpAddr, Ipv4Addr, SocketAddr}; 3 | //use std::str::FromStr; 4 | 5 | fn main() { 6 | // let addr = format!("0.0.0.0.{}", 69); 7 | // let socket_addr = SocketAddr::from_str(addr.as_str()).unwrap(); 8 | let socket_addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 69); 9 | let builder = TftpServerBuilder::new().addr(socket_addr); 10 | let mut server = builder.build().unwrap(); 11 | server.run().expect("some error"); 12 | } 13 | -------------------------------------------------------------------------------- /udp/client/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::net::UdpSocket; 2 | use std::{io, str}; 3 | 4 | fn main() -> io::Result<()> { 5 | let socket = UdpSocket::bind("127.0.0.1:8000")?; 6 | socket.connect("127.0.0.1:8080")?; 7 | 8 | loop{ 9 | let mut input = String::new(); 10 | io::stdin().read_line(&mut input)?; 11 | socket.send(input.as_bytes())?; 12 | 13 | let mut buffer = [0u8; 1500]; 14 | let (_size, _src) = socket.recv_from(&mut buffer)?; 15 | 16 | println!("recv: {}", 17 | str::from_utf8(&buffer).expect("Could not write buffer as string")); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ftp/use_ftp/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::str; 2 | use std::io::Cursor; 3 | use ftp::FtpStream; 4 | 5 | fn main() { 6 | let mut ftp_stream = FtpStream::connect("127.0.0.1:21").unwrap(); 7 | let _ = ftp_stream.login("tt", "1").unwrap(); 8 | 9 | println!("Current directory: {}", ftp_stream.pwd().unwrap()); 10 | let remote_file = ftp_stream.simple_retr("./hello").unwrap(); 11 | println!("Contents: \n{}\n", str::from_utf8(&remote_file.into_inner()).unwrap()); 12 | 13 | let mut reader = Cursor::new("Hello from client".as_bytes()); 14 | let _ = ftp_stream.put("upload", &mut reader); 15 | 16 | let _ = ftp_stream.quit(); 17 | } 18 | -------------------------------------------------------------------------------- /use_grpc/foobar.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package foobar; 4 | 5 | service FooBarService { 6 | rpc record_cab_location(CabLocationRequest) returns (CabLocationResponse); 7 | rpc get_cabs(GetCabRequest) returns (GetCabResponse); 8 | } 9 | 10 | message CabLocationRequest { 11 | string name = 1; 12 | Location location = 2; 13 | } 14 | 15 | message CabLocationResponse { 16 | bool accepted = 1; 17 | } 18 | 19 | message GetCabRequest { 20 | Location location = 1; 21 | } 22 | 23 | message GetCabResponse { 24 | repeated Cab cabs = 1; 25 | } 26 | 27 | message Cab { 28 | string name = 1; 29 | Location location = 2; 30 | } 31 | 32 | message Location { 33 | float latitude = 1; 34 | float longitude = 2; 35 | } 36 | -------------------------------------------------------------------------------- /tcp/client/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::io::{self, prelude::*, BufReader, Write}; 2 | use std::net::TcpStream; 3 | use std::str; 4 | 5 | fn main() -> io::Result<()> { 6 | let mut stream = TcpStream::connect("127.0.0.1:8080")?; 7 | for _ in 0..10 { 8 | let mut input = String::new(); 9 | io::stdin().read_line(&mut input).expect("Failed to read"); 10 | stream.write(input.as_bytes()).expect("Failed to write"); 11 | 12 | let mut reader = BufReader::new(&stream); 13 | let mut buffer: Vec = Vec::new(); 14 | reader.read_until(b'\n', &mut buffer).expect("Failed to read into buffer"); 15 | println!("read from server: {}", str::from_utf8(&buffer).unwrap()); 16 | println!(""); 17 | } 18 | println!("Hello, world!"); 19 | Ok(()) 20 | } 21 | -------------------------------------------------------------------------------- /use_socketaddr/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr}; 2 | 3 | fn main() { 4 | let mut v4 = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 8080); 5 | let mut v6 = SocketAddr::new(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 65535, 0, 1)), 8080); 6 | 7 | assert_eq!(v4.ip(), IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1))); 8 | 9 | v4.set_ip(IpAddr::V4(Ipv4Addr::new(192, 168, 0, 1))); 10 | assert_eq!(v4.ip(), IpAddr::V4(Ipv4Addr::new(192, 168, 0, 1))); 11 | 12 | v6.set_ip(IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 65535, 1, 1))); 13 | 14 | assert_eq!(v4.port(), 8080); 15 | v4.set_port(1025); 16 | 17 | v6.set_port(1025); 18 | 19 | assert_eq!(v4.is_ipv4(), true); 20 | assert_eq!(v6.is_ipv4(), false); 21 | 22 | assert_eq!(v4.is_ipv6(), false); 23 | assert_eq!(v6.is_ipv6(), true); 24 | } 25 | -------------------------------------------------------------------------------- /use_ipaddr/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; 2 | 3 | // pub enum IpAddr { 4 | // V4(Ipv4Addr), 5 | // V6(Ipv6Addr), 6 | // } 7 | 8 | fn main() { 9 | let v4 = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)); 10 | let v6 = IpAddr::V6(Ipv6Addr::new(0, 0, 0, 0, 0, 0, 0, 1)); 11 | 12 | assert_eq!("127.0.0.1".parse(), Ok(v4)); 13 | assert_eq!("::1".parse(), Ok(v6)); 14 | 15 | assert_eq!(v4.is_loopback(), true); 16 | assert_eq!(v6.is_loopback(), true); 17 | assert_eq!(IpAddr::V4(Ipv4Addr::new(192, 168, 0, 1)).is_loopback(), false); 18 | 19 | assert_eq!(v4.is_multicast(), false); 20 | assert_eq!(v6.is_multicast(), false); 21 | assert_eq!(IpAddr::V4(Ipv4Addr::new(224, 254, 0, 0)).is_multicast(), true); 22 | 23 | assert_eq!(v4.is_ipv4(), true); 24 | assert_eq!(v6.is_ipv6(), true); 25 | 26 | assert_eq!(v4.is_ipv6(), false); 27 | assert_eq!(v6.is_ipv4(), false); 28 | } 29 | -------------------------------------------------------------------------------- /use_ipnet/src/main.rs: -------------------------------------------------------------------------------- 1 | use ipnet::{IpNet, Ipv4Net, Ipv6Net}; 2 | use std::net::{Ipv4Addr, Ipv6Addr}; 3 | use std::str::FromStr; 4 | 5 | fn main() -> std::io::Result<()> { 6 | let _v4 = Ipv4Net::new(Ipv4Addr::new(10, 1, 1, 0), 24).unwrap(); 7 | let _v6 = Ipv6Net::new(Ipv6Addr::new(0xfd, 0, 0, 0, 0, 0, 0, 0), 24).unwrap(); 8 | 9 | let _v4 = Ipv4Net::from_str("10.1.1.0/24").unwrap(); 10 | let _v6 = Ipv6Net::from_str("fd00::/24").unwrap(); 11 | 12 | let v4: Ipv4Net = "10.1.1.0/24".parse().unwrap(); 13 | let _v6: Ipv6Net = "fd00::/24".parse().unwrap(); 14 | 15 | let _net = IpNet::from(v4); 16 | 17 | let _net = IpNet::from_str("10.1.1.0/24").unwrap(); 18 | let net: IpNet = "10.1.1.0/24".parse().unwrap(); 19 | 20 | println!("{}, hostmask = {}", net, net.hostmask()); 21 | println!("{}, netmask = {}", net, net.netmask()); 22 | 23 | assert_eq!( 24 | "192.168.12.34/16".parse::().unwrap().trunc(), 25 | "192.168.0.0/16".parse().unwrap() 26 | ); 27 | 28 | Ok(()) 29 | } 30 | -------------------------------------------------------------------------------- /tcp/server/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::net::{TcpListener, TcpStream}; 2 | use std::thread; 3 | use std::time; 4 | use std::io::{self, Read, Write}; 5 | 6 | fn handle_client(mut stream: TcpStream) -> io::Result<()> { 7 | let mut buf = [0; 512]; 8 | for _ in 0..1000 { 9 | let bytes_read = stream.read(&mut buf)?; 10 | if bytes_read == 0 { 11 | return Ok(()); 12 | } 13 | 14 | stream.write(&buf[..bytes_read])?; 15 | thread::sleep(time::Duration::from_secs(1)); 16 | } 17 | Ok(()) 18 | } 19 | 20 | fn main() -> io::Result<()> { 21 | let listener = TcpListener::bind("127.0.0.1:8080")?; 22 | let mut thread_vec: Vec> = Vec::new(); 23 | 24 | for stream in listener.incoming() { 25 | let stream = stream.expect("failed"); 26 | let handle = thread::spawn(move || { 27 | handle_client(stream).unwrap_or_else(|error| eprintln!("{:?}", error)); 28 | }); 29 | thread_vec.push(handle); 30 | } 31 | 32 | for handle in thread_vec { 33 | handle.join().unwrap(); 34 | } 35 | Ok(()) 36 | } 37 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 说明 2 | 本项目为Rust网络编程对应源码 3 | 4 | # 视频地址 5 | ## 基础部分地址 6 | 头条地址:https://www.ixigua.com/i6765442674582356483 7 | 8 | B站地址:https://www.bilibili.com/video/av78062009?p=1 9 | 10 | 网易云课堂地址:https://study.163.com/course/introduction.htm?courseId=1209596906#/courseDetail?tab=1 11 | 12 | ## 进阶部分地址 13 | 头条地址:https://www.ixigua.com/i6775861706447913485 14 | 15 | B站地址:https://www.bilibili.com/video/av81202308/ 16 | 17 | 网易云课堂地址:https://study.163.com/course/introduction/1209784858.htm 18 | 19 | ## blockchain地址 20 | 西瓜视频地址:https://www.ixigua.com/pseries/6812409394718835213_6812405410780152331/ 21 | B站地址:https://www.bilibili.com/video/BV145411t7qp?from=search&seid=9322223665501755087 22 | 23 | ## webserver地址 24 | 西瓜视频地址:https://www.ixigua.com/pseries/6809213474934096395_6807565880101175812/ 25 | B站地址:https://www.bilibili.com/video/BV177411m784?from=search&seid=9322223665501755087 26 | 27 | ## Rust网络编程地址 28 | 西瓜视频地址:https://www.ixigua.com/pseries/6822959064889164292/?logTag=O1zEkpZw6y9CBLIwepxLD 29 | B站地址:https://www.bilibili.com/video/BV1b54y1X7my?from=search&seid=1411938997848533975 30 | 31 | 32 | # 课件地址 33 | 相关课件已发布到B站/CSDN(令狐壹冲)/头条号(令狐一冲a)/微信公众号/简书(令狐一冲) 34 | -------------------------------------------------------------------------------- /use_dns/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::env; 2 | use trust_dns_resolver::Resolver; 3 | use trust_dns_resolver::config::*; 4 | use trust_dns::rr::record_type::RecordType; 5 | 6 | fn main() { 7 | let args: Vec = env::args().collect(); 8 | if args.len() != 2 { 9 | eprintln!("Please provide a name to query!"); 10 | std::process::exit(1); 11 | } 12 | 13 | let query = format!("{}.", args[1]); 14 | 15 | println!(""); 16 | println!("use default config:"); 17 | let resolver = 18 | Resolver::new(ResolverConfig::default(), ResolverOpts::default()).unwrap(); 19 | let response = resolver.lookup_ip(query.as_str()); 20 | for ans in response.iter() { 21 | println!("{:?}", ans); 22 | } 23 | 24 | println!(""); 25 | println!("use system config:"); 26 | let resolver = 27 | Resolver::from_system_conf().unwrap(); 28 | let response = resolver.lookup_ip(query.as_str()); 29 | for ans in response.iter() { 30 | println!("{:?}", ans); 31 | } 32 | 33 | println!(""); 34 | println!("use ns:"); 35 | let ns = resolver.lookup(query.as_str(), RecordType::NS); 36 | for ans in ns.iter() { 37 | println!("{:?}", ans); 38 | } 39 | 40 | println!("Hello, world!"); 41 | } 42 | -------------------------------------------------------------------------------- /ftp/ftp介绍.md: -------------------------------------------------------------------------------- 1 | # FTP协议介绍 2 | FTP(File Transfer Protocol,文件传输协议)是 TCP/IP 协议组中的协议之一。其主要作用是在服务器和客户端之间实现文件的传输和共享。FTP协议运行在TCP连接上,保证了文件传输的可靠性。 3 | 4 | FTP使用了两个并行的tcp来传输文件:一个是控制连接,使用21号端口;一个是数据连接,使用20号端口,控制连接用于在两个主机之间传输控制信息,如口令,用户标识,存放、获取文件等命令。数据连接用于实际发送一个文件,发送完文件之后数据连接会关闭。 5 | 6 | FTP主要有主动模式和被动模式两种。主动模式是FTP客户端告诉服务端用哪个端口作为数据端口,然后让服务端来连接自己。被动模式则是由客户端发起控制连接请求和数据连接请求。 7 | 8 | # ubuntu下搭建FTP服务器 9 | 本节搭建一个FTP服务器,可用于我们后续进行测试。 10 | 11 | * 创建文件夹 12 | ``` 13 | cd ~ 14 | mkdir ftpserver 15 | ``` 16 | * 安装ftp服务器 17 | ``` 18 | sudo apt-get install vsftpd 19 | ``` 20 | * 配置vsftpd.conf文件: 21 | ``` 22 | sudo vim /etc/vsftpd.conf 23 | ``` 24 | 添加如下: 25 | ``` 26 | anonymous_enable=NO 27 | anon_root=/home/xxx/ftpserver 28 | no_anon_password=YES 29 | write_enable=YES 30 | anon_upload_enable=YES 31 | anon_mkdir_write_enable=YES 32 | ``` 33 | * 添加组用户 34 | ``` 35 | sudo groupadd ftpgroup 36 | ``` 37 | * 增加用户,例如用户名为tt 38 | ``` 39 | sudo useradd -g ftpgroup -d ~/ftpserver/tt -M tt 40 | ``` 41 | * 创建tt对应的文件夹tt 42 | ``` 43 | mkdir tt //在ftpserver目录下 44 | sudo chmod 777 tt 45 | ``` 46 | * 设置密码 47 | ``` 48 | sudo passwd tt 49 | ``` 50 | * 重启vsftpd 51 | ``` 52 | sudo /etc/init.d/vsftpd restart 53 | ``` 54 | 55 | # 测试 56 | * 打开终端,输入: 57 | ``` 58 | ftp 127.0.0.1 59 | ``` 60 | * 输入用户名tt 61 | * 输入密码 62 | * 使用get命令下载 63 | * 使用put命令上传 -------------------------------------------------------------------------------- /use_serde1/src/main.rs: -------------------------------------------------------------------------------- 1 | // serde crate 是 Serde 生态的核心。 2 | // serde_derive crate 提供必要的工具, 3 | // 使用过程宏来派生 Serialize 和 Deserialize。 4 | // 但是serde只提供序列化和反序列化的框架,具体的操作还需要依赖具体的包, 5 | // 如serde_json和serde_yaml等。 6 | use serde::{Deserialize, Serialize}; 7 | 8 | #[derive(Debug, Serialize, Deserialize)] 9 | struct ServerConfig { 10 | workers: u64, 11 | ignore: bool, 12 | auth_server: Option, 13 | } 14 | 15 | fn main() { 16 | let config = ServerConfig { 17 | workers: 100, 18 | ignore: false, 19 | auth_server: Some("auth.server.io".to_string()), 20 | }; 21 | 22 | { 23 | println!("json:"); 24 | let serialized = serde_json::to_string(&config).unwrap(); 25 | println!("serialized: {}", serialized); 26 | 27 | let deserialized: ServerConfig = serde_json::from_str(&serialized).unwrap(); 28 | println!("deserialized: {:#?}", deserialized); 29 | } 30 | 31 | { 32 | println!("yaml:"); 33 | let serialized = serde_yaml::to_string(&config).unwrap(); 34 | println!("serialized: {}", serialized); 35 | 36 | let deserialized: ServerConfig = serde_yaml::from_str(&serialized).unwrap(); 37 | println!("deserialized: {:#?}", deserialized); 38 | } 39 | 40 | println!("Hello, world!"); 41 | } 42 | -------------------------------------------------------------------------------- /use_lettre/src/main.rs: -------------------------------------------------------------------------------- 1 | use lettre::smtp::authentication::Credentials; 2 | use lettre::{SmtpClient, Transport}; 3 | use lettre_email::{EmailBuilder, Mailbox}; 4 | 5 | fn main() { 6 | let email = EmailBuilder::new() 7 | .from(Mailbox::new("发送者的邮箱地址".to_string())) 8 | //.from(Mailbox::new("xiaoming@163.com".to_string())) //发送者:xiaoming@163.com 9 | .to(Mailbox::new("接收者邮箱地址".to_string())) 10 | //.to(Mailbox::new("xiaohong@126.com".to_string())) //接收者:xiaohong@126.com 11 | .subject("Test") //邮件标题 12 | .body("This is a test email!") //邮件内容 13 | .build() 14 | .unwrap(); 15 | 16 | //for example: xiaoming@163.com, password: 123456 17 | //let creds = Credentials::new("xiaoming".to_string(), "123456".to_string()); 18 | let creds = Credentials::new("你的邮箱用户名".to_string(), "你的邮箱密码".to_string()); 19 | 20 | //如163的邮箱就是smtp.163.com, 126的邮箱就是smtp.126.com 21 | let mut mailer = SmtpClient::new_simple("邮箱服务器地址") 22 | .unwrap() 23 | .credentials(creds) 24 | .transport(); 25 | 26 | let result = mailer.send(email.into()); 27 | 28 | if result.is_ok() { 29 | println!("Email sent"); 30 | } else { 31 | println!("Could not send email: {:?}", result); 32 | } 33 | 34 | assert!(result.is_ok()); 35 | } 36 | -------------------------------------------------------------------------------- /use_serde2/client/src/main.rs: -------------------------------------------------------------------------------- 1 | use serde::{Deserialize, Serialize}; 2 | use serde_json; 3 | 4 | use std::io::{self, prelude::*, BufReader, Write}; 5 | use std::net::TcpStream; 6 | use std::str; 7 | 8 | #[derive(Debug, Serialize, Deserialize)] 9 | struct Point3D { 10 | x: u32, 11 | y: u32, 12 | z: u32, 13 | } 14 | 15 | fn main() -> io::Result<()>{ 16 | let mut stream = TcpStream::connect("127.0.0.1:8080")?; 17 | loop { 18 | let mut input = String::new(); 19 | let mut buffer: Vec = Vec::new(); 20 | io::stdin() 21 | .read_line(&mut input) 22 | .expect("Failed to read from stdin"); 23 | let parts: Vec<&str> = input.trim_matches('\n').split(',').collect(); 24 | let point = Point3D { 25 | x: parts[0].parse().unwrap(), 26 | y: parts[1].parse().unwrap(), 27 | z: parts[2].parse().unwrap(), 28 | }; 29 | 30 | stream 31 | .write_all(serde_json::to_string(&point).unwrap().as_bytes()) 32 | .expect("Failed to write"); 33 | stream.write_all(b"\n")?; 34 | 35 | let mut reader = BufReader::new(&stream); 36 | reader.read_until(b'\n', &mut buffer)?; 37 | let input = str::from_utf8(&buffer).unwrap(); 38 | if input == "" { 39 | eprintln!("Empty response"); 40 | } 41 | 42 | println!("Response: {}", input); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /use_mio/src/main.rs: -------------------------------------------------------------------------------- 1 | use mio::net::{TcpListener, TcpStream}; 2 | use mio::{Events, Interest, Poll, Token}; 3 | 4 | const SERVER: Token = Token(0); 5 | const CLIENT: Token = Token(1); 6 | 7 | fn main() -> std::io::Result<()> { 8 | let mut poll = Poll::new()?; 9 | let mut events = Events::with_capacity(128); 10 | 11 | let addr = "127.0.0.1:8080".parse().unwrap(); 12 | let mut server = TcpListener::bind(addr)?; 13 | 14 | poll.registry().register(&mut server, SERVER, Interest::READABLE)?; 15 | 16 | let mut client = TcpStream::connect(addr)?; 17 | poll.registry() 18 | .register(&mut client, CLIENT, Interest::READABLE | Interest::WRITABLE)?; 19 | 20 | loop { 21 | poll.poll(&mut events, None)?; 22 | 23 | for event in events.iter() { 24 | match event.token() { 25 | SERVER => { 26 | let connection = server.accept(); 27 | println!("SERVER recv a connection!"); 28 | drop(connection); 29 | } 30 | CLIENT => { 31 | if event.is_writable() { 32 | println!("CLIENT write"); 33 | } 34 | 35 | if event.is_readable() { 36 | println!("CLIENT read"); 37 | } 38 | 39 | return Ok(()) 40 | } 41 | 42 | _ => unreachable!(), 43 | } 44 | } 45 | 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /use_grpc/src/bin/client.rs: -------------------------------------------------------------------------------- 1 | use use_grpc::foobar::*; //use_grpc为当前包的名字,如果名字不一样需要修改 2 | use use_grpc::foobar_grpc::*; //use_grpc为当前包的名字,如果名字不一样需要修改 3 | use futures::executor; 4 | 5 | use grpc::ClientStubExt; 6 | 7 | 8 | fn main() { 9 | let client = 10 | FooBarServiceClient::new_plain("127.0.0.1", 11 | 9001, 12 | Default::default()) 13 | .unwrap(); 14 | 15 | let mut req = CabLocationRequest::new(); 16 | req.set_name("foo".to_string()); 17 | 18 | let mut location = Location::new(); 19 | location.latitude = 40.730610; 20 | location.longitude = -73.935242; 21 | req.set_location(location); 22 | 23 | let resp = client 24 | .record_cab_location(grpc::RequestOptions::new(), req) 25 | .join_metadata_result(); //future 26 | let resp = executor::block_on(resp); 27 | match resp { 28 | Err(e) => panic!("{:?}", e), 29 | Ok((_, r, _)) => println!("{:?}", r), 30 | } 31 | 32 | let mut nearby_req = GetCabRequest::new(); 33 | let mut location = Location::new(); 34 | location.latitude = 40.730610; 35 | location.longitude = -73.935242; 36 | nearby_req.set_location(location); 37 | 38 | let nearby_resp = client 39 | .get_cabs(grpc::RequestOptions::new(), nearby_req) 40 | .join_metadata_result(); //返回future 41 | let nearby_resp = executor::block_on(nearby_resp); 42 | match nearby_resp { 43 | Err(e) => panic!("{:?}", e), 44 | Ok((_, cabs, _)) => println!("{:?}", cabs), 45 | } 46 | } -------------------------------------------------------------------------------- /use_serde2/server/src/main.rs: -------------------------------------------------------------------------------- 1 | use serde::{Deserialize, Serialize}; 2 | use serde_json; 3 | 4 | use std::io::{self, prelude::*, BufReader, Write}; 5 | use std::net::{TcpListener, TcpStream}; 6 | use std::{thread, str}; 7 | 8 | #[derive(Debug, Serialize, Deserialize)] 9 | struct Point3D { 10 | x: u32, 11 | y: u32, 12 | z: u32, 13 | } 14 | 15 | fn handle_client(stream: TcpStream) -> io::Result<()> { 16 | println!("Incoming connection from: {}", stream.peer_addr()?); 17 | let mut data = Vec::new(); 18 | let mut stream = BufReader::new(stream); 19 | 20 | loop { 21 | data.clear(); 22 | let bytes_read = stream.read_until(b'\n', &mut data)?; 23 | if bytes_read == 0 { 24 | return Ok(()); 25 | } 26 | 27 | let input: Point3D = serde_json::from_slice(&data)?; 28 | let value = input.x.pow(2) + input.y.pow(2) + input.z.pow(2); 29 | 30 | stream.get_mut().write(&(serde_json::to_vec(&(f64::from(value).sqrt()))?))?; 31 | stream.get_mut().write(&("\n".as_bytes()))?; 32 | stream.get_mut().flush()?; 33 | } 34 | } 35 | 36 | fn main() -> io::Result<()> { 37 | 38 | let listener = TcpListener::bind("0.0.0.0:8080")?; 39 | for stream in listener.incoming() { 40 | match stream { 41 | Err(e) => eprintln!("error: {}", e), 42 | Ok(stream) => { 43 | thread::spawn(move || { 44 | handle_client(stream) 45 | .unwrap_or_else(|error| eprintln!("error: {}", error)); 46 | }); 47 | } 48 | } 49 | } 50 | 51 | Ok(()) 52 | } 53 | -------------------------------------------------------------------------------- /use_grpc/src/bin/server.rs: -------------------------------------------------------------------------------- 1 | use std::thread; 2 | use use_grpc::foobar_grpc::*; 3 | use use_grpc::foobar::*; 4 | 5 | struct FooBarServer; 6 | 7 | impl FooBarService for FooBarServer { 8 | fn record_cab_location(&self, 9 | _o: grpc::ServerHandlerContext, 10 | req: grpc::ServerRequestSingle, 11 | resp: grpc::ServerResponseUnarySink) 12 | -> grpc::Result<()> 13 | { 14 | let mut r = CabLocationResponse::new(); 15 | println!("Record cab {} at {}, {}", 16 | req.message.get_name(), 17 | req.message.get_location().latitude, 18 | req.message.get_location().longitude); 19 | 20 | r.set_accepted(true); 21 | resp.finish(r) 22 | } 23 | 24 | fn get_cabs(&self, 25 | _o: grpc::ServerHandlerContext, 26 | _req: grpc::ServerRequestSingle, 27 | resp: grpc::ServerResponseUnarySink) 28 | -> grpc::Result<()> 29 | { 30 | let mut r = GetCabResponse::new(); 31 | 32 | let mut location = Location::new(); 33 | location.latitude = 40.7128; 34 | location.longitude = -74.0060; 35 | 36 | let mut one = Cab::new(); 37 | one.set_name("Limo".to_owned()); 38 | one.set_location(location.clone()); 39 | 40 | let mut two = Cab::new(); 41 | two.set_name("Merc".to_owned()); 42 | two.set_location(location.clone()); 43 | 44 | let vec = vec![one, two]; 45 | let cabs = ::protobuf::RepeatedField::from_vec(vec); 46 | 47 | r.set_cabs(cabs); 48 | 49 | resp.finish(r) 50 | } 51 | } 52 | 53 | fn main() { 54 | let mut server = grpc::ServerBuilder::new_plain(); 55 | server.http.set_port(9001); 56 | server.add_service(FooBarServiceServer::new_service_def(FooBarServer)); 57 | let _server = server.build().expect("Could not start server"); 58 | loop { 59 | thread::park(); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /use_pnet/src/main.rs: -------------------------------------------------------------------------------- 1 | use pnet::datalink::Channel::Ethernet; 2 | use pnet::datalink::{self, NetworkInterface}; 3 | use pnet::packet::ethernet::{EthernetPacket, EtherTypes}; 4 | use pnet::packet::ip::IpNextHeaderProtocols; 5 | use pnet::packet::ipv4::Ipv4Packet; 6 | use pnet::packet::tcp::TcpPacket; 7 | use pnet::packet::Packet; 8 | 9 | use std::env; 10 | 11 | 12 | fn main() { 13 | let interface_name = env::args().nth(1).unwrap(); 14 | 15 | let interfaces = datalink::interfaces(); 16 | let interface = interfaces 17 | .into_iter() 18 | .filter(|iface: &NetworkInterface| iface.name == interface_name) 19 | .next() 20 | .expect("Error get interface"); 21 | 22 | let (_tx, mut rx) = match datalink::channel(&interface, Default::default()) { 23 | Ok(Ethernet(tx, rx)) => (tx, rx), 24 | Ok(_) => panic!("Other"), 25 | Err(e) => panic!("error: {}", e), 26 | }; 27 | 28 | loop { 29 | match rx.next() { 30 | Ok(packet) => { 31 | let packet = EthernetPacket::new(packet).unwrap(); 32 | handle_packet(&packet); 33 | }, 34 | Err(e) => { 35 | println!("Some error: {}", e); 36 | } 37 | } 38 | } 39 | } 40 | 41 | fn handle_packet(ethernet: &EthernetPacket) { 42 | match ethernet.get_ethertype() { 43 | EtherTypes::Ipv4 => { 44 | let header = Ipv4Packet::new(ethernet.payload()); 45 | if let Some(header) = header { 46 | match header.get_next_level_protocol() { 47 | IpNextHeaderProtocols::Tcp => { 48 | let tcp = TcpPacket::new(header.payload()); 49 | if let Some(tcp) = tcp { 50 | println!("Tcp packet {}: {} to {}: {}", 51 | header.get_source(), 52 | tcp.get_source(), 53 | header.get_destination(), 54 | tcp.get_destination()); 55 | } 56 | } 57 | _ => println!("igno"), 58 | } 59 | } 60 | } 61 | _ => println!("ignoring"), 62 | } 63 | } -------------------------------------------------------------------------------- /use_serde2/client/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "client" 5 | version = "0.1.0" 6 | dependencies = [ 7 | "serde", 8 | "serde_json", 9 | ] 10 | 11 | [[package]] 12 | name = "itoa" 13 | version = "0.4.5" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" 16 | 17 | [[package]] 18 | name = "proc-macro2" 19 | version = "1.0.12" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "8872cf6f48eee44265156c111456a700ab3483686b3f96df4cf5481c89157319" 22 | dependencies = [ 23 | "unicode-xid", 24 | ] 25 | 26 | [[package]] 27 | name = "quote" 28 | version = "1.0.4" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "4c1f4b0efa5fc5e8ceb705136bfee52cfdb6a4e3509f770b478cd6ed434232a7" 31 | dependencies = [ 32 | "proc-macro2", 33 | ] 34 | 35 | [[package]] 36 | name = "ryu" 37 | version = "1.0.4" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "ed3d612bc64430efeb3f7ee6ef26d590dce0c43249217bddc62112540c7941e1" 40 | 41 | [[package]] 42 | name = "serde" 43 | version = "1.0.106" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399" 46 | dependencies = [ 47 | "serde_derive", 48 | ] 49 | 50 | [[package]] 51 | name = "serde_derive" 52 | version = "1.0.106" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c" 55 | dependencies = [ 56 | "proc-macro2", 57 | "quote", 58 | "syn", 59 | ] 60 | 61 | [[package]] 62 | name = "serde_json" 63 | version = "1.0.52" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "a7894c8ed05b7a3a279aeb79025fdec1d3158080b75b98a08faf2806bb799edd" 66 | dependencies = [ 67 | "itoa", 68 | "ryu", 69 | "serde", 70 | ] 71 | 72 | [[package]] 73 | name = "syn" 74 | version = "1.0.18" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | checksum = "410a7488c0a728c7ceb4ad59b9567eb4053d02e8cc7f5c0e0eeeb39518369213" 77 | dependencies = [ 78 | "proc-macro2", 79 | "quote", 80 | "unicode-xid", 81 | ] 82 | 83 | [[package]] 84 | name = "unicode-xid" 85 | version = "0.2.0" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 88 | -------------------------------------------------------------------------------- /use_serde2/server/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "itoa" 5 | version = "0.4.5" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" 8 | 9 | [[package]] 10 | name = "proc-macro2" 11 | version = "1.0.12" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | checksum = "8872cf6f48eee44265156c111456a700ab3483686b3f96df4cf5481c89157319" 14 | dependencies = [ 15 | "unicode-xid", 16 | ] 17 | 18 | [[package]] 19 | name = "quote" 20 | version = "1.0.4" 21 | source = "registry+https://github.com/rust-lang/crates.io-index" 22 | checksum = "4c1f4b0efa5fc5e8ceb705136bfee52cfdb6a4e3509f770b478cd6ed434232a7" 23 | dependencies = [ 24 | "proc-macro2", 25 | ] 26 | 27 | [[package]] 28 | name = "ryu" 29 | version = "1.0.4" 30 | source = "registry+https://github.com/rust-lang/crates.io-index" 31 | checksum = "ed3d612bc64430efeb3f7ee6ef26d590dce0c43249217bddc62112540c7941e1" 32 | 33 | [[package]] 34 | name = "serde" 35 | version = "1.0.106" 36 | source = "registry+https://github.com/rust-lang/crates.io-index" 37 | checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399" 38 | dependencies = [ 39 | "serde_derive", 40 | ] 41 | 42 | [[package]] 43 | name = "serde_derive" 44 | version = "1.0.106" 45 | source = "registry+https://github.com/rust-lang/crates.io-index" 46 | checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c" 47 | dependencies = [ 48 | "proc-macro2", 49 | "quote", 50 | "syn", 51 | ] 52 | 53 | [[package]] 54 | name = "serde_json" 55 | version = "1.0.52" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "a7894c8ed05b7a3a279aeb79025fdec1d3158080b75b98a08faf2806bb799edd" 58 | dependencies = [ 59 | "itoa", 60 | "ryu", 61 | "serde", 62 | ] 63 | 64 | [[package]] 65 | name = "server" 66 | version = "0.1.0" 67 | dependencies = [ 68 | "serde", 69 | "serde_json", 70 | ] 71 | 72 | [[package]] 73 | name = "syn" 74 | version = "1.0.18" 75 | source = "registry+https://github.com/rust-lang/crates.io-index" 76 | checksum = "410a7488c0a728c7ceb4ad59b9567eb4053d02e8cc7f5c0e0eeeb39518369213" 77 | dependencies = [ 78 | "proc-macro2", 79 | "quote", 80 | "unicode-xid", 81 | ] 82 | 83 | [[package]] 84 | name = "unicode-xid" 85 | version = "0.2.0" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 88 | -------------------------------------------------------------------------------- /tftp/tftp介绍.md: -------------------------------------------------------------------------------- 1 | ## TFTP介绍 2 | 3 | TFTP(Trivial File Transfer Protocol,简单文件传输协议)是TCP/IP协议族中的一个用来在客户机与服务器之间进行简单文件传输的协议,提供不复杂、开销不大的文件传输服务。TFTP基于UDP,对应端口号为69. 4 | 5 | ## TFTP报文格式 6 | ### TFTP协议 7 | 8 | ``` 9 | 10 | | 2bytes | String | 2bytes | String | 2bytes | 11 | 12 | ------------------------------------------------ 13 | 14 | | Opcode | Filename | 0 | Mode | 0 | 15 | 16 | ------------------------------------------------ 17 | 18 | ``` 19 | 20 | * Opcode字段 21 | 22 | 操作码/命令 23 | 24 | ``` 25 | 26 | -------------------------------------------------- 27 | 28 | | Opcode | Command | Description | 29 | 30 | -------------------------------------------------- 31 | 32 | | 1 | Read Request | Request to read a file | 33 | 34 | | 2 | Write Request| Request to write a file| 35 | 36 | | 3 | File Data | Transfer of file data | 37 | 38 | | 4 | Data Ack | Ack of file data | 39 | 40 | | 5 | Error | Error indication | 41 | 42 | -------------------------------------------------- 43 | 44 | ``` 45 | 46 | * Filename字段 47 | 48 | 文件的名字。 49 | 50 | * Mode字段 51 | 52 | 数据模式。协议传输的文件数据格式,可以是NetASCII,也可以是标准ASCII,八位二进制数据或邮件标准ASCII。在邮件模式已经不再支持。 53 | 54 | ### 报文 55 | 56 | * 读写报文 57 | 58 | ``` 59 | 60 | | 2bytes | String | 2bytes | String | 2bytes | 61 | 62 | ------------------------------------------------ 63 | 64 | | Opcode=1/2 | Filename | 0 | Mode | 0 | 65 | 66 | ------------------------------------------------ 67 | 68 | ``` 69 | 70 | * 数据报文 71 | 72 | ``` 73 | 74 | | 2bytes | 2bytes | 512 bytes| 75 | 76 | -------------------------------------- 77 | 78 | | Opcode=3 | block number | Data | 79 | 80 | -------------------------------------- 81 | 82 | ``` 83 | 84 | * ACK报文 85 | 86 | ``` 87 | 88 | | 2bytes | 2bytes | 89 | 90 | --------------------------- 91 | 92 | | Opcode=4 | block number | 93 | 94 | --------------------------- 95 | 96 | ``` 97 | 98 | * ERROR报文 99 | 100 | ``` 101 | 102 | | 2bytes | 2bytes | N bytes | 103 | 104 | ------------------------------------------- 105 | 106 | | Opcode=5 | error number | error message | 107 | 108 | ------------------------------------------- 109 | 110 | ``` 111 | 112 | ## 传输过程 113 | 114 | ``` 115 | 116 | 1、客户端发送读/写请求; 117 | 118 | 2、服务端同意请求,文件以固定的512字节块的长度发送; 119 | 120 | 3、再发送下一个包之前,需要先等待之前的块得到确认; 121 | 122 | 4、如果包中数据少于512字节,则说明是最后一个数据包,传输结束; 123 | 124 | 5、如果包丢失,则超时重传。 125 | 126 | ``` 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /use_mio/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "cfg-if" 5 | version = "0.1.10" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 8 | 9 | [[package]] 10 | name = "lazy_static" 11 | version = "1.4.0" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 14 | 15 | [[package]] 16 | name = "libc" 17 | version = "0.2.69" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | checksum = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005" 20 | 21 | [[package]] 22 | name = "log" 23 | version = "0.4.8" 24 | source = "registry+https://github.com/rust-lang/crates.io-index" 25 | checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" 26 | dependencies = [ 27 | "cfg-if", 28 | ] 29 | 30 | [[package]] 31 | name = "mio" 32 | version = "0.7.0" 33 | source = "registry+https://github.com/rust-lang/crates.io-index" 34 | checksum = "6e9971bc8349a361217a8f2a41f5d011274686bd4436465ba51730921039d7fb" 35 | dependencies = [ 36 | "lazy_static", 37 | "libc", 38 | "log", 39 | "miow", 40 | "ntapi", 41 | "winapi", 42 | ] 43 | 44 | [[package]] 45 | name = "miow" 46 | version = "0.3.3" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "396aa0f2003d7df8395cb93e09871561ccc3e785f0acb369170e8cc74ddf9226" 49 | dependencies = [ 50 | "socket2", 51 | "winapi", 52 | ] 53 | 54 | [[package]] 55 | name = "ntapi" 56 | version = "0.3.3" 57 | source = "registry+https://github.com/rust-lang/crates.io-index" 58 | checksum = "f26e041cd983acbc087e30fcba770380cfa352d0e392e175b2344ebaf7ea0602" 59 | dependencies = [ 60 | "winapi", 61 | ] 62 | 63 | [[package]] 64 | name = "redox_syscall" 65 | version = "0.1.56" 66 | source = "registry+https://github.com/rust-lang/crates.io-index" 67 | checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" 68 | 69 | [[package]] 70 | name = "socket2" 71 | version = "0.3.12" 72 | source = "registry+https://github.com/rust-lang/crates.io-index" 73 | checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" 74 | dependencies = [ 75 | "cfg-if", 76 | "libc", 77 | "redox_syscall", 78 | "winapi", 79 | ] 80 | 81 | [[package]] 82 | name = "use_mio" 83 | version = "0.1.0" 84 | dependencies = [ 85 | "mio", 86 | ] 87 | 88 | [[package]] 89 | name = "winapi" 90 | version = "0.3.8" 91 | source = "registry+https://github.com/rust-lang/crates.io-index" 92 | checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 93 | dependencies = [ 94 | "winapi-i686-pc-windows-gnu", 95 | "winapi-x86_64-pc-windows-gnu", 96 | ] 97 | 98 | [[package]] 99 | name = "winapi-i686-pc-windows-gnu" 100 | version = "0.4.0" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 103 | 104 | [[package]] 105 | name = "winapi-x86_64-pc-windows-gnu" 106 | version = "0.4.0" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 109 | -------------------------------------------------------------------------------- /use_serde1/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "dtoa" 5 | version = "0.4.5" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" 8 | 9 | [[package]] 10 | name = "itoa" 11 | version = "0.4.5" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" 14 | 15 | [[package]] 16 | name = "linked-hash-map" 17 | version = "0.5.2" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | checksum = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" 20 | 21 | [[package]] 22 | name = "proc-macro2" 23 | version = "1.0.12" 24 | source = "registry+https://github.com/rust-lang/crates.io-index" 25 | checksum = "8872cf6f48eee44265156c111456a700ab3483686b3f96df4cf5481c89157319" 26 | dependencies = [ 27 | "unicode-xid", 28 | ] 29 | 30 | [[package]] 31 | name = "quote" 32 | version = "1.0.4" 33 | source = "registry+https://github.com/rust-lang/crates.io-index" 34 | checksum = "4c1f4b0efa5fc5e8ceb705136bfee52cfdb6a4e3509f770b478cd6ed434232a7" 35 | dependencies = [ 36 | "proc-macro2", 37 | ] 38 | 39 | [[package]] 40 | name = "ryu" 41 | version = "1.0.4" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | checksum = "ed3d612bc64430efeb3f7ee6ef26d590dce0c43249217bddc62112540c7941e1" 44 | 45 | [[package]] 46 | name = "serde" 47 | version = "1.0.106" 48 | source = "registry+https://github.com/rust-lang/crates.io-index" 49 | checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399" 50 | dependencies = [ 51 | "serde_derive", 52 | ] 53 | 54 | [[package]] 55 | name = "serde_derive" 56 | version = "1.0.106" 57 | source = "registry+https://github.com/rust-lang/crates.io-index" 58 | checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c" 59 | dependencies = [ 60 | "proc-macro2", 61 | "quote", 62 | "syn", 63 | ] 64 | 65 | [[package]] 66 | name = "serde_json" 67 | version = "1.0.52" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "a7894c8ed05b7a3a279aeb79025fdec1d3158080b75b98a08faf2806bb799edd" 70 | dependencies = [ 71 | "itoa", 72 | "ryu", 73 | "serde", 74 | ] 75 | 76 | [[package]] 77 | name = "serde_yaml" 78 | version = "0.8.11" 79 | source = "registry+https://github.com/rust-lang/crates.io-index" 80 | checksum = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35" 81 | dependencies = [ 82 | "dtoa", 83 | "linked-hash-map", 84 | "serde", 85 | "yaml-rust", 86 | ] 87 | 88 | [[package]] 89 | name = "syn" 90 | version = "1.0.18" 91 | source = "registry+https://github.com/rust-lang/crates.io-index" 92 | checksum = "410a7488c0a728c7ceb4ad59b9567eb4053d02e8cc7f5c0e0eeeb39518369213" 93 | dependencies = [ 94 | "proc-macro2", 95 | "quote", 96 | "unicode-xid", 97 | ] 98 | 99 | [[package]] 100 | name = "unicode-xid" 101 | version = "0.2.0" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 104 | 105 | [[package]] 106 | name = "use_serde1" 107 | version = "0.1.0" 108 | dependencies = [ 109 | "serde", 110 | "serde_json", 111 | "serde_yaml", 112 | ] 113 | 114 | [[package]] 115 | name = "yaml-rust" 116 | version = "0.4.3" 117 | source = "registry+https://github.com/rust-lang/crates.io-index" 118 | checksum = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d" 119 | dependencies = [ 120 | "linked-hash-map", 121 | ] 122 | -------------------------------------------------------------------------------- /use_grpc/src/foobar_grpc.rs: -------------------------------------------------------------------------------- 1 | // This file is generated. Do not edit 2 | // @generated 3 | 4 | // https://github.com/Manishearth/rust-clippy/issues/702 5 | #![allow(unknown_lints)] 6 | #![allow(clippy::all)] 7 | 8 | #![cfg_attr(rustfmt, rustfmt_skip)] 9 | 10 | #![allow(box_pointers)] 11 | #![allow(dead_code)] 12 | #![allow(missing_docs)] 13 | #![allow(non_camel_case_types)] 14 | #![allow(non_snake_case)] 15 | #![allow(non_upper_case_globals)] 16 | #![allow(trivial_casts)] 17 | #![allow(unsafe_code)] 18 | #![allow(unused_imports)] 19 | #![allow(unused_results)] 20 | 21 | 22 | // server interface 23 | 24 | pub trait FooBarService { 25 | fn record_cab_location(&self, o: ::grpc::ServerHandlerContext, req: ::grpc::ServerRequestSingle, resp: ::grpc::ServerResponseUnarySink) -> ::grpc::Result<()>; 26 | 27 | fn get_cabs(&self, o: ::grpc::ServerHandlerContext, req: ::grpc::ServerRequestSingle, resp: ::grpc::ServerResponseUnarySink) -> ::grpc::Result<()>; 28 | } 29 | 30 | // client 31 | 32 | pub struct FooBarServiceClient { 33 | grpc_client: ::std::sync::Arc<::grpc::Client>, 34 | } 35 | 36 | impl ::grpc::ClientStub for FooBarServiceClient { 37 | fn with_client(grpc_client: ::std::sync::Arc<::grpc::Client>) -> Self { 38 | FooBarServiceClient { 39 | grpc_client: grpc_client, 40 | } 41 | } 42 | } 43 | 44 | impl FooBarServiceClient { 45 | pub fn record_cab_location(&self, o: ::grpc::RequestOptions, req: super::foobar::CabLocationRequest) -> ::grpc::SingleResponse { 46 | let descriptor = ::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor { 47 | name: ::grpc::rt::StringOrStatic::Static("/foobar.FooBarService/record_cab_location"), 48 | streaming: ::grpc::rt::GrpcStreaming::Unary, 49 | req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf), 50 | resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf), 51 | }); 52 | self.grpc_client.call_unary(o, req, descriptor) 53 | } 54 | 55 | pub fn get_cabs(&self, o: ::grpc::RequestOptions, req: super::foobar::GetCabRequest) -> ::grpc::SingleResponse { 56 | let descriptor = ::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor { 57 | name: ::grpc::rt::StringOrStatic::Static("/foobar.FooBarService/get_cabs"), 58 | streaming: ::grpc::rt::GrpcStreaming::Unary, 59 | req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf), 60 | resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf), 61 | }); 62 | self.grpc_client.call_unary(o, req, descriptor) 63 | } 64 | } 65 | 66 | // server 67 | 68 | pub struct FooBarServiceServer; 69 | 70 | 71 | impl FooBarServiceServer { 72 | pub fn new_service_def(handler: H) -> ::grpc::rt::ServerServiceDefinition { 73 | let handler_arc = ::std::sync::Arc::new(handler); 74 | ::grpc::rt::ServerServiceDefinition::new("/foobar.FooBarService", 75 | vec![ 76 | ::grpc::rt::ServerMethod::new( 77 | ::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor { 78 | name: ::grpc::rt::StringOrStatic::Static("/foobar.FooBarService/record_cab_location"), 79 | streaming: ::grpc::rt::GrpcStreaming::Unary, 80 | req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf), 81 | resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf), 82 | }), 83 | { 84 | let handler_copy = handler_arc.clone(); 85 | ::grpc::rt::MethodHandlerUnary::new(move |ctx, req, resp| (*handler_copy).record_cab_location(ctx, req, resp)) 86 | }, 87 | ), 88 | ::grpc::rt::ServerMethod::new( 89 | ::grpc::rt::ArcOrStatic::Static(&::grpc::rt::MethodDescriptor { 90 | name: ::grpc::rt::StringOrStatic::Static("/foobar.FooBarService/get_cabs"), 91 | streaming: ::grpc::rt::GrpcStreaming::Unary, 92 | req_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf), 93 | resp_marshaller: ::grpc::rt::ArcOrStatic::Static(&::grpc_protobuf::MarshallerProtobuf), 94 | }), 95 | { 96 | let handler_copy = handler_arc.clone(); 97 | ::grpc::rt::MethodHandlerUnary::new(move |ctx, req, resp| (*handler_copy).get_cabs(ctx, req, resp)) 98 | }, 99 | ), 100 | ], 101 | ) 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /ftp/use_ftp/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "aho-corasick" 5 | version = "0.5.3" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" 8 | dependencies = [ 9 | "memchr", 10 | ] 11 | 12 | [[package]] 13 | name = "autocfg" 14 | version = "1.0.0" 15 | source = "registry+https://github.com/rust-lang/crates.io-index" 16 | checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 17 | 18 | [[package]] 19 | name = "chrono" 20 | version = "0.2.25" 21 | source = "registry+https://github.com/rust-lang/crates.io-index" 22 | checksum = "9213f7cd7c27e95c2b57c49f0e69b1ea65b27138da84a170133fd21b07659c00" 23 | dependencies = [ 24 | "num", 25 | "time", 26 | ] 27 | 28 | [[package]] 29 | name = "ftp" 30 | version = "3.0.1" 31 | source = "registry+https://github.com/rust-lang/crates.io-index" 32 | checksum = "542951aad0071952c27409e3bd7cb62d1a3ad419c4e7314106bf994e0083ad5d" 33 | dependencies = [ 34 | "chrono", 35 | "lazy_static", 36 | "regex", 37 | ] 38 | 39 | [[package]] 40 | name = "kernel32-sys" 41 | version = "0.2.2" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 44 | dependencies = [ 45 | "winapi 0.2.8", 46 | "winapi-build", 47 | ] 48 | 49 | [[package]] 50 | name = "lazy_static" 51 | version = "0.1.16" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | checksum = "cf186d1a8aa5f5bee5fd662bc9c1b949e0259e1bcc379d1f006847b0080c7417" 54 | 55 | [[package]] 56 | name = "libc" 57 | version = "0.2.70" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "3baa92041a6fec78c687fa0cc2b3fae8884f743d672cf551bed1d6dac6988d0f" 60 | 61 | [[package]] 62 | name = "memchr" 63 | version = "0.1.11" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" 66 | dependencies = [ 67 | "libc", 68 | ] 69 | 70 | [[package]] 71 | name = "num" 72 | version = "0.1.42" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | checksum = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" 75 | dependencies = [ 76 | "num-integer", 77 | "num-iter", 78 | "num-traits", 79 | ] 80 | 81 | [[package]] 82 | name = "num-integer" 83 | version = "0.1.42" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" 86 | dependencies = [ 87 | "autocfg", 88 | "num-traits", 89 | ] 90 | 91 | [[package]] 92 | name = "num-iter" 93 | version = "0.1.40" 94 | source = "registry+https://github.com/rust-lang/crates.io-index" 95 | checksum = "dfb0800a0291891dd9f4fe7bd9c19384f98f7fbe0cd0f39a2c6b88b9868bbc00" 96 | dependencies = [ 97 | "autocfg", 98 | "num-integer", 99 | "num-traits", 100 | ] 101 | 102 | [[package]] 103 | name = "num-traits" 104 | version = "0.2.11" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" 107 | dependencies = [ 108 | "autocfg", 109 | ] 110 | 111 | [[package]] 112 | name = "regex" 113 | version = "0.1.80" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | checksum = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" 116 | dependencies = [ 117 | "aho-corasick", 118 | "memchr", 119 | "regex-syntax", 120 | "thread_local", 121 | "utf8-ranges", 122 | ] 123 | 124 | [[package]] 125 | name = "regex-syntax" 126 | version = "0.3.9" 127 | source = "registry+https://github.com/rust-lang/crates.io-index" 128 | checksum = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" 129 | 130 | [[package]] 131 | name = "thread-id" 132 | version = "2.0.0" 133 | source = "registry+https://github.com/rust-lang/crates.io-index" 134 | checksum = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" 135 | dependencies = [ 136 | "kernel32-sys", 137 | "libc", 138 | ] 139 | 140 | [[package]] 141 | name = "thread_local" 142 | version = "0.2.7" 143 | source = "registry+https://github.com/rust-lang/crates.io-index" 144 | checksum = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" 145 | dependencies = [ 146 | "thread-id", 147 | ] 148 | 149 | [[package]] 150 | name = "time" 151 | version = "0.1.43" 152 | source = "registry+https://github.com/rust-lang/crates.io-index" 153 | checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" 154 | dependencies = [ 155 | "libc", 156 | "winapi 0.3.8", 157 | ] 158 | 159 | [[package]] 160 | name = "use_ftp" 161 | version = "0.1.0" 162 | dependencies = [ 163 | "ftp", 164 | ] 165 | 166 | [[package]] 167 | name = "utf8-ranges" 168 | version = "0.1.3" 169 | source = "registry+https://github.com/rust-lang/crates.io-index" 170 | checksum = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" 171 | 172 | [[package]] 173 | name = "winapi" 174 | version = "0.2.8" 175 | source = "registry+https://github.com/rust-lang/crates.io-index" 176 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 177 | 178 | [[package]] 179 | name = "winapi" 180 | version = "0.3.8" 181 | source = "registry+https://github.com/rust-lang/crates.io-index" 182 | checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 183 | dependencies = [ 184 | "winapi-i686-pc-windows-gnu", 185 | "winapi-x86_64-pc-windows-gnu", 186 | ] 187 | 188 | [[package]] 189 | name = "winapi-build" 190 | version = "0.1.1" 191 | source = "registry+https://github.com/rust-lang/crates.io-index" 192 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 193 | 194 | [[package]] 195 | name = "winapi-i686-pc-windows-gnu" 196 | version = "0.4.0" 197 | source = "registry+https://github.com/rust-lang/crates.io-index" 198 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 199 | 200 | [[package]] 201 | name = "winapi-x86_64-pc-windows-gnu" 202 | version = "0.4.0" 203 | source = "registry+https://github.com/rust-lang/crates.io-index" 204 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 205 | -------------------------------------------------------------------------------- /use_pnet/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "aho-corasick" 5 | version = "0.7.10" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada" 8 | dependencies = [ 9 | "memchr", 10 | ] 11 | 12 | [[package]] 13 | name = "bitflags" 14 | version = "0.5.0" 15 | source = "registry+https://github.com/rust-lang/crates.io-index" 16 | checksum = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23" 17 | 18 | [[package]] 19 | name = "cfg-if" 20 | version = "0.1.10" 21 | source = "registry+https://github.com/rust-lang/crates.io-index" 22 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 23 | 24 | [[package]] 25 | name = "glob" 26 | version = "0.2.11" 27 | source = "registry+https://github.com/rust-lang/crates.io-index" 28 | checksum = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" 29 | 30 | [[package]] 31 | name = "ipnetwork" 32 | version = "0.16.0" 33 | source = "registry+https://github.com/rust-lang/crates.io-index" 34 | checksum = "b8eca9f51da27bc908ef3dd85c21e1bbba794edaf94d7841e37356275b82d31e" 35 | dependencies = [ 36 | "serde", 37 | ] 38 | 39 | [[package]] 40 | name = "kernel32-sys" 41 | version = "0.2.2" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 44 | dependencies = [ 45 | "winapi", 46 | "winapi-build", 47 | ] 48 | 49 | [[package]] 50 | name = "lazy_static" 51 | version = "1.4.0" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 54 | 55 | [[package]] 56 | name = "libc" 57 | version = "0.2.69" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005" 60 | 61 | [[package]] 62 | name = "log" 63 | version = "0.3.9" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" 66 | dependencies = [ 67 | "log 0.4.8", 68 | ] 69 | 70 | [[package]] 71 | name = "log" 72 | version = "0.4.8" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" 75 | dependencies = [ 76 | "cfg-if", 77 | ] 78 | 79 | [[package]] 80 | name = "memchr" 81 | version = "2.3.3" 82 | source = "registry+https://github.com/rust-lang/crates.io-index" 83 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 84 | 85 | [[package]] 86 | name = "pnet" 87 | version = "0.26.0" 88 | source = "registry+https://github.com/rust-lang/crates.io-index" 89 | checksum = "c62df42dcd72f6f2a658bcf38509f1027df1440ac85f1af4badbe034418302dc" 90 | dependencies = [ 91 | "ipnetwork", 92 | "pnet_base", 93 | "pnet_datalink", 94 | "pnet_packet", 95 | "pnet_sys", 96 | "pnet_transport", 97 | ] 98 | 99 | [[package]] 100 | name = "pnet_base" 101 | version = "0.26.0" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | checksum = "b7cd5f7e15220afa66b0a9a62841ea10089f39dcaa1c29752c0b22dfc03111b5" 104 | 105 | [[package]] 106 | name = "pnet_datalink" 107 | version = "0.26.0" 108 | source = "registry+https://github.com/rust-lang/crates.io-index" 109 | checksum = "7318ae1d6e0b7fa1e49933233c9473f2b72d3d18b97e70e2716c6415dde5f915" 110 | dependencies = [ 111 | "ipnetwork", 112 | "libc", 113 | "pnet_base", 114 | "pnet_sys", 115 | "winapi", 116 | ] 117 | 118 | [[package]] 119 | name = "pnet_macros" 120 | version = "0.26.0" 121 | source = "registry+https://github.com/rust-lang/crates.io-index" 122 | checksum = "bbbd5c52c6e04aa720400f9c71cd0e8bcb38cd13421d5caabd9035e9efa47de9" 123 | dependencies = [ 124 | "regex", 125 | "syntex", 126 | "syntex_syntax", 127 | ] 128 | 129 | [[package]] 130 | name = "pnet_macros_support" 131 | version = "0.26.0" 132 | source = "registry+https://github.com/rust-lang/crates.io-index" 133 | checksum = "daf9c5c0c36766d0a4da9ab268c0700771b8ec367b9463fd678109fa28463c5b" 134 | dependencies = [ 135 | "pnet_base", 136 | ] 137 | 138 | [[package]] 139 | name = "pnet_packet" 140 | version = "0.26.0" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "89e26a864d71d0ac51a549cf40283c44ed1b8f98168545638a4730ef9f560283" 143 | dependencies = [ 144 | "glob", 145 | "pnet_base", 146 | "pnet_macros", 147 | "pnet_macros_support", 148 | "syntex", 149 | ] 150 | 151 | [[package]] 152 | name = "pnet_sys" 153 | version = "0.26.0" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "73f0de0c52609f157b25d79ce24d9016ab1bbf10cde761397200d634a833872c" 156 | dependencies = [ 157 | "libc", 158 | "winapi", 159 | "ws2_32-sys", 160 | ] 161 | 162 | [[package]] 163 | name = "pnet_transport" 164 | version = "0.26.0" 165 | source = "registry+https://github.com/rust-lang/crates.io-index" 166 | checksum = "6712ab76534340494d849e3c51c64a6261e4b451337b7c05bd3681e384c48b10" 167 | dependencies = [ 168 | "libc", 169 | "pnet_base", 170 | "pnet_packet", 171 | "pnet_sys", 172 | ] 173 | 174 | [[package]] 175 | name = "regex" 176 | version = "1.3.7" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | checksum = "a6020f034922e3194c711b82a627453881bc4682166cabb07134a10c26ba7692" 179 | dependencies = [ 180 | "aho-corasick", 181 | "memchr", 182 | "regex-syntax", 183 | "thread_local", 184 | ] 185 | 186 | [[package]] 187 | name = "regex-syntax" 188 | version = "0.6.17" 189 | source = "registry+https://github.com/rust-lang/crates.io-index" 190 | checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" 191 | 192 | [[package]] 193 | name = "rustc-serialize" 194 | version = "0.3.24" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" 197 | 198 | [[package]] 199 | name = "serde" 200 | version = "1.0.106" 201 | source = "registry+https://github.com/rust-lang/crates.io-index" 202 | checksum = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399" 203 | 204 | [[package]] 205 | name = "syntex" 206 | version = "0.42.2" 207 | source = "registry+https://github.com/rust-lang/crates.io-index" 208 | checksum = "0a30b08a6b383a22e5f6edc127d169670d48f905bb00ca79a00ea3e442ebe317" 209 | dependencies = [ 210 | "syntex_errors", 211 | "syntex_syntax", 212 | ] 213 | 214 | [[package]] 215 | name = "syntex_errors" 216 | version = "0.42.0" 217 | source = "registry+https://github.com/rust-lang/crates.io-index" 218 | checksum = "04c48f32867b6114449155b2a82114b86d4b09e1bddb21c47ff104ab9172b646" 219 | dependencies = [ 220 | "libc", 221 | "log 0.3.9", 222 | "rustc-serialize", 223 | "syntex_pos", 224 | "term", 225 | "unicode-xid", 226 | ] 227 | 228 | [[package]] 229 | name = "syntex_pos" 230 | version = "0.42.0" 231 | source = "registry+https://github.com/rust-lang/crates.io-index" 232 | checksum = "3fd49988e52451813c61fecbe9abb5cfd4e1b7bb6cdbb980a6fbcbab859171a6" 233 | dependencies = [ 234 | "rustc-serialize", 235 | ] 236 | 237 | [[package]] 238 | name = "syntex_syntax" 239 | version = "0.42.0" 240 | source = "registry+https://github.com/rust-lang/crates.io-index" 241 | checksum = "7628a0506e8f9666fdabb5f265d0059b059edac9a3f810bda077abb5d826bd8d" 242 | dependencies = [ 243 | "bitflags", 244 | "libc", 245 | "log 0.3.9", 246 | "rustc-serialize", 247 | "syntex_errors", 248 | "syntex_pos", 249 | "term", 250 | "unicode-xid", 251 | ] 252 | 253 | [[package]] 254 | name = "term" 255 | version = "0.4.6" 256 | source = "registry+https://github.com/rust-lang/crates.io-index" 257 | checksum = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1" 258 | dependencies = [ 259 | "kernel32-sys", 260 | "winapi", 261 | ] 262 | 263 | [[package]] 264 | name = "thread_local" 265 | version = "1.0.1" 266 | source = "registry+https://github.com/rust-lang/crates.io-index" 267 | checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" 268 | dependencies = [ 269 | "lazy_static", 270 | ] 271 | 272 | [[package]] 273 | name = "unicode-xid" 274 | version = "0.0.3" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | checksum = "36dff09cafb4ec7c8cf0023eb0b686cb6ce65499116a12201c9e11840ca01beb" 277 | 278 | [[package]] 279 | name = "use_pnet" 280 | version = "0.1.0" 281 | dependencies = [ 282 | "pnet", 283 | ] 284 | 285 | [[package]] 286 | name = "winapi" 287 | version = "0.2.8" 288 | source = "registry+https://github.com/rust-lang/crates.io-index" 289 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 290 | 291 | [[package]] 292 | name = "winapi-build" 293 | version = "0.1.1" 294 | source = "registry+https://github.com/rust-lang/crates.io-index" 295 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 296 | 297 | [[package]] 298 | name = "ws2_32-sys" 299 | version = "0.2.1" 300 | source = "registry+https://github.com/rust-lang/crates.io-index" 301 | checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 302 | dependencies = [ 303 | "winapi", 304 | "winapi-build", 305 | ] 306 | -------------------------------------------------------------------------------- /tftp/use_tftp/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "aho-corasick" 5 | version = "0.5.3" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" 8 | dependencies = [ 9 | "memchr", 10 | ] 11 | 12 | [[package]] 13 | name = "bitflags" 14 | version = "1.2.1" 15 | source = "registry+https://github.com/rust-lang/crates.io-index" 16 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 17 | 18 | [[package]] 19 | name = "byteorder" 20 | version = "0.5.3" 21 | source = "registry+https://github.com/rust-lang/crates.io-index" 22 | checksum = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" 23 | 24 | [[package]] 25 | name = "cfg-if" 26 | version = "0.1.10" 27 | source = "registry+https://github.com/rust-lang/crates.io-index" 28 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 29 | 30 | [[package]] 31 | name = "env_logger" 32 | version = "0.3.5" 33 | source = "registry+https://github.com/rust-lang/crates.io-index" 34 | checksum = "15abd780e45b3ea4f76b4e9a26ff4843258dd8a3eed2775a0e7368c2e7936c2f" 35 | dependencies = [ 36 | "log 0.3.9", 37 | "regex", 38 | ] 39 | 40 | [[package]] 41 | name = "fuchsia-cprng" 42 | version = "0.1.1" 43 | source = "registry+https://github.com/rust-lang/crates.io-index" 44 | checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" 45 | 46 | [[package]] 47 | name = "fuchsia-zircon" 48 | version = "0.3.3" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 51 | dependencies = [ 52 | "bitflags", 53 | "fuchsia-zircon-sys", 54 | ] 55 | 56 | [[package]] 57 | name = "fuchsia-zircon-sys" 58 | version = "0.3.3" 59 | source = "registry+https://github.com/rust-lang/crates.io-index" 60 | checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 61 | 62 | [[package]] 63 | name = "iovec" 64 | version = "0.1.4" 65 | source = "registry+https://github.com/rust-lang/crates.io-index" 66 | checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 67 | dependencies = [ 68 | "libc", 69 | ] 70 | 71 | [[package]] 72 | name = "kernel32-sys" 73 | version = "0.2.2" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 76 | dependencies = [ 77 | "winapi 0.2.8", 78 | "winapi-build", 79 | ] 80 | 81 | [[package]] 82 | name = "lazycell" 83 | version = "1.2.1" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" 86 | 87 | [[package]] 88 | name = "libc" 89 | version = "0.2.70" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "3baa92041a6fec78c687fa0cc2b3fae8884f743d672cf551bed1d6dac6988d0f" 92 | 93 | [[package]] 94 | name = "log" 95 | version = "0.3.9" 96 | source = "registry+https://github.com/rust-lang/crates.io-index" 97 | checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" 98 | dependencies = [ 99 | "log 0.4.8", 100 | ] 101 | 102 | [[package]] 103 | name = "log" 104 | version = "0.4.8" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" 107 | dependencies = [ 108 | "cfg-if", 109 | ] 110 | 111 | [[package]] 112 | name = "memchr" 113 | version = "0.1.11" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | checksum = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" 116 | dependencies = [ 117 | "libc", 118 | ] 119 | 120 | [[package]] 121 | name = "mio" 122 | version = "0.6.22" 123 | source = "registry+https://github.com/rust-lang/crates.io-index" 124 | checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" 125 | dependencies = [ 126 | "cfg-if", 127 | "fuchsia-zircon", 128 | "fuchsia-zircon-sys", 129 | "iovec", 130 | "kernel32-sys", 131 | "libc", 132 | "log 0.4.8", 133 | "miow", 134 | "net2", 135 | "slab", 136 | "winapi 0.2.8", 137 | ] 138 | 139 | [[package]] 140 | name = "mio-extras" 141 | version = "2.0.6" 142 | source = "registry+https://github.com/rust-lang/crates.io-index" 143 | checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" 144 | dependencies = [ 145 | "lazycell", 146 | "log 0.4.8", 147 | "mio", 148 | "slab", 149 | ] 150 | 151 | [[package]] 152 | name = "miow" 153 | version = "0.2.1" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 156 | dependencies = [ 157 | "kernel32-sys", 158 | "net2", 159 | "winapi 0.2.8", 160 | "ws2_32-sys", 161 | ] 162 | 163 | [[package]] 164 | name = "net2" 165 | version = "0.2.34" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" 168 | dependencies = [ 169 | "cfg-if", 170 | "libc", 171 | "winapi 0.3.8", 172 | ] 173 | 174 | [[package]] 175 | name = "rand" 176 | version = "0.3.23" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" 179 | dependencies = [ 180 | "libc", 181 | "rand 0.4.6", 182 | ] 183 | 184 | [[package]] 185 | name = "rand" 186 | version = "0.4.6" 187 | source = "registry+https://github.com/rust-lang/crates.io-index" 188 | checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" 189 | dependencies = [ 190 | "fuchsia-cprng", 191 | "libc", 192 | "rand_core 0.3.1", 193 | "rdrand", 194 | "winapi 0.3.8", 195 | ] 196 | 197 | [[package]] 198 | name = "rand_core" 199 | version = "0.3.1" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" 202 | dependencies = [ 203 | "rand_core 0.4.2", 204 | ] 205 | 206 | [[package]] 207 | name = "rand_core" 208 | version = "0.4.2" 209 | source = "registry+https://github.com/rust-lang/crates.io-index" 210 | checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" 211 | 212 | [[package]] 213 | name = "rdrand" 214 | version = "0.4.0" 215 | source = "registry+https://github.com/rust-lang/crates.io-index" 216 | checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" 217 | dependencies = [ 218 | "rand_core 0.3.1", 219 | ] 220 | 221 | [[package]] 222 | name = "regex" 223 | version = "0.1.80" 224 | source = "registry+https://github.com/rust-lang/crates.io-index" 225 | checksum = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" 226 | dependencies = [ 227 | "aho-corasick", 228 | "memchr", 229 | "regex-syntax", 230 | "thread_local", 231 | "utf8-ranges", 232 | ] 233 | 234 | [[package]] 235 | name = "regex-syntax" 236 | version = "0.3.9" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" 239 | 240 | [[package]] 241 | name = "slab" 242 | version = "0.4.2" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 245 | 246 | [[package]] 247 | name = "tftp_server" 248 | version = "0.0.3" 249 | source = "registry+https://github.com/rust-lang/crates.io-index" 250 | checksum = "ffecb866af64bf514b1c0c4c75ea37e2fa54bea7fbf22c1b9157ef576cac0f8d" 251 | dependencies = [ 252 | "byteorder", 253 | "env_logger", 254 | "log 0.4.8", 255 | "mio", 256 | "mio-extras", 257 | "rand 0.3.23", 258 | ] 259 | 260 | [[package]] 261 | name = "thread-id" 262 | version = "2.0.0" 263 | source = "registry+https://github.com/rust-lang/crates.io-index" 264 | checksum = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" 265 | dependencies = [ 266 | "kernel32-sys", 267 | "libc", 268 | ] 269 | 270 | [[package]] 271 | name = "thread_local" 272 | version = "0.2.7" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" 275 | dependencies = [ 276 | "thread-id", 277 | ] 278 | 279 | [[package]] 280 | name = "use_tftp" 281 | version = "0.1.0" 282 | dependencies = [ 283 | "tftp_server", 284 | ] 285 | 286 | [[package]] 287 | name = "utf8-ranges" 288 | version = "0.1.3" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" 291 | 292 | [[package]] 293 | name = "winapi" 294 | version = "0.2.8" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 297 | 298 | [[package]] 299 | name = "winapi" 300 | version = "0.3.8" 301 | source = "registry+https://github.com/rust-lang/crates.io-index" 302 | checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 303 | dependencies = [ 304 | "winapi-i686-pc-windows-gnu", 305 | "winapi-x86_64-pc-windows-gnu", 306 | ] 307 | 308 | [[package]] 309 | name = "winapi-build" 310 | version = "0.1.1" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 313 | 314 | [[package]] 315 | name = "winapi-i686-pc-windows-gnu" 316 | version = "0.4.0" 317 | source = "registry+https://github.com/rust-lang/crates.io-index" 318 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 319 | 320 | [[package]] 321 | name = "winapi-x86_64-pc-windows-gnu" 322 | version = "0.4.0" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 325 | 326 | [[package]] 327 | name = "ws2_32-sys" 328 | version = "0.2.1" 329 | source = "registry+https://github.com/rust-lang/crates.io-index" 330 | checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 331 | dependencies = [ 332 | "winapi 0.2.8", 333 | "winapi-build", 334 | ] 335 | -------------------------------------------------------------------------------- /use_lettre/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "ascii_utils" 5 | version = "0.9.3" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "71938f30533e4d95a6d17aa530939da3842c2ab6f4f84b9dae68447e4129f74a" 8 | 9 | [[package]] 10 | name = "autocfg" 11 | version = "0.1.7" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" 14 | 15 | [[package]] 16 | name = "autocfg" 17 | version = "1.0.0" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 20 | 21 | [[package]] 22 | name = "base64" 23 | version = "0.9.3" 24 | source = "registry+https://github.com/rust-lang/crates.io-index" 25 | checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" 26 | dependencies = [ 27 | "byteorder", 28 | "safemem", 29 | ] 30 | 31 | [[package]] 32 | name = "base64" 33 | version = "0.10.1" 34 | source = "registry+https://github.com/rust-lang/crates.io-index" 35 | checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" 36 | dependencies = [ 37 | "byteorder", 38 | ] 39 | 40 | [[package]] 41 | name = "bitflags" 42 | version = "1.2.1" 43 | source = "registry+https://github.com/rust-lang/crates.io-index" 44 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 45 | 46 | [[package]] 47 | name = "bufstream" 48 | version = "0.1.4" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | checksum = "40e38929add23cdf8a366df9b0e088953150724bcbe5fc330b0d8eb3b328eec8" 51 | 52 | [[package]] 53 | name = "byteorder" 54 | version = "1.3.4" 55 | source = "registry+https://github.com/rust-lang/crates.io-index" 56 | checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" 57 | 58 | [[package]] 59 | name = "cc" 60 | version = "1.0.52" 61 | source = "registry+https://github.com/rust-lang/crates.io-index" 62 | checksum = "c3d87b23d6a92cd03af510a5ade527033f6aa6fa92161e2d5863a907d4c5e31d" 63 | 64 | [[package]] 65 | name = "cfg-if" 66 | version = "0.1.10" 67 | source = "registry+https://github.com/rust-lang/crates.io-index" 68 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 69 | 70 | [[package]] 71 | name = "chrono" 72 | version = "0.4.11" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | checksum = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2" 75 | dependencies = [ 76 | "num-integer", 77 | "num-traits", 78 | "time", 79 | ] 80 | 81 | [[package]] 82 | name = "cloudabi" 83 | version = "0.0.3" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" 86 | dependencies = [ 87 | "bitflags", 88 | ] 89 | 90 | [[package]] 91 | name = "core-foundation" 92 | version = "0.7.0" 93 | source = "registry+https://github.com/rust-lang/crates.io-index" 94 | checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" 95 | dependencies = [ 96 | "core-foundation-sys", 97 | "libc", 98 | ] 99 | 100 | [[package]] 101 | name = "core-foundation-sys" 102 | version = "0.7.0" 103 | source = "registry+https://github.com/rust-lang/crates.io-index" 104 | checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" 105 | 106 | [[package]] 107 | name = "email" 108 | version = "0.0.20" 109 | source = "registry+https://github.com/rust-lang/crates.io-index" 110 | checksum = "91549a51bb0241165f13d57fc4c72cef063b4088fb078b019ecbf464a45f22e4" 111 | dependencies = [ 112 | "base64 0.9.3", 113 | "chrono", 114 | "encoding", 115 | "lazy_static", 116 | "rand 0.4.6", 117 | "time", 118 | "version_check", 119 | ] 120 | 121 | [[package]] 122 | name = "encoding" 123 | version = "0.2.33" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | checksum = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec" 126 | dependencies = [ 127 | "encoding-index-japanese", 128 | "encoding-index-korean", 129 | "encoding-index-simpchinese", 130 | "encoding-index-singlebyte", 131 | "encoding-index-tradchinese", 132 | ] 133 | 134 | [[package]] 135 | name = "encoding-index-japanese" 136 | version = "1.20141219.5" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91" 139 | dependencies = [ 140 | "encoding_index_tests", 141 | ] 142 | 143 | [[package]] 144 | name = "encoding-index-korean" 145 | version = "1.20141219.5" 146 | source = "registry+https://github.com/rust-lang/crates.io-index" 147 | checksum = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81" 148 | dependencies = [ 149 | "encoding_index_tests", 150 | ] 151 | 152 | [[package]] 153 | name = "encoding-index-simpchinese" 154 | version = "1.20141219.5" 155 | source = "registry+https://github.com/rust-lang/crates.io-index" 156 | checksum = "d87a7194909b9118fc707194baa434a4e3b0fb6a5a757c73c3adb07aa25031f7" 157 | dependencies = [ 158 | "encoding_index_tests", 159 | ] 160 | 161 | [[package]] 162 | name = "encoding-index-singlebyte" 163 | version = "1.20141219.5" 164 | source = "registry+https://github.com/rust-lang/crates.io-index" 165 | checksum = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a" 166 | dependencies = [ 167 | "encoding_index_tests", 168 | ] 169 | 170 | [[package]] 171 | name = "encoding-index-tradchinese" 172 | version = "1.20141219.5" 173 | source = "registry+https://github.com/rust-lang/crates.io-index" 174 | checksum = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" 175 | dependencies = [ 176 | "encoding_index_tests", 177 | ] 178 | 179 | [[package]] 180 | name = "encoding_index_tests" 181 | version = "0.1.4" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" 184 | 185 | [[package]] 186 | name = "fast_chemail" 187 | version = "0.9.6" 188 | source = "registry+https://github.com/rust-lang/crates.io-index" 189 | checksum = "495a39d30d624c2caabe6312bfead73e7717692b44e0b32df168c275a2e8e9e4" 190 | dependencies = [ 191 | "ascii_utils", 192 | ] 193 | 194 | [[package]] 195 | name = "foreign-types" 196 | version = "0.3.2" 197 | source = "registry+https://github.com/rust-lang/crates.io-index" 198 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 199 | dependencies = [ 200 | "foreign-types-shared", 201 | ] 202 | 203 | [[package]] 204 | name = "foreign-types-shared" 205 | version = "0.1.1" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 208 | 209 | [[package]] 210 | name = "fuchsia-cprng" 211 | version = "0.1.1" 212 | source = "registry+https://github.com/rust-lang/crates.io-index" 213 | checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" 214 | 215 | [[package]] 216 | name = "getrandom" 217 | version = "0.1.14" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" 220 | dependencies = [ 221 | "cfg-if", 222 | "libc", 223 | "wasi", 224 | ] 225 | 226 | [[package]] 227 | name = "hostname" 228 | version = "0.1.5" 229 | source = "registry+https://github.com/rust-lang/crates.io-index" 230 | checksum = "21ceb46a83a85e824ef93669c8b390009623863b5c195d1ba747292c0c72f94e" 231 | dependencies = [ 232 | "libc", 233 | "winutil", 234 | ] 235 | 236 | [[package]] 237 | name = "itoa" 238 | version = "0.4.5" 239 | source = "registry+https://github.com/rust-lang/crates.io-index" 240 | checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" 241 | 242 | [[package]] 243 | name = "lazy_static" 244 | version = "1.4.0" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 247 | 248 | [[package]] 249 | name = "lettre" 250 | version = "0.9.3" 251 | source = "registry+https://github.com/rust-lang/crates.io-index" 252 | checksum = "bf43f3202a879fbdab4ecafec3349b0139f81d31c626246d53bcbb546253ffaa" 253 | dependencies = [ 254 | "base64 0.10.1", 255 | "bufstream", 256 | "fast_chemail", 257 | "hostname", 258 | "log", 259 | "native-tls", 260 | "nom", 261 | "serde", 262 | "serde_derive", 263 | "serde_json", 264 | ] 265 | 266 | [[package]] 267 | name = "lettre_email" 268 | version = "0.9.4" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "fd02480f8dcf48798e62113974d6ccca2129a51d241fa20f1ea349c8a42559d5" 271 | dependencies = [ 272 | "base64 0.10.1", 273 | "email", 274 | "lettre", 275 | "mime", 276 | "time", 277 | "uuid", 278 | ] 279 | 280 | [[package]] 281 | name = "libc" 282 | version = "0.2.69" 283 | source = "registry+https://github.com/rust-lang/crates.io-index" 284 | checksum = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005" 285 | 286 | [[package]] 287 | name = "log" 288 | version = "0.4.8" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" 291 | dependencies = [ 292 | "cfg-if", 293 | ] 294 | 295 | [[package]] 296 | name = "memchr" 297 | version = "2.3.3" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 300 | 301 | [[package]] 302 | name = "mime" 303 | version = "0.3.16" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 306 | 307 | [[package]] 308 | name = "native-tls" 309 | version = "0.2.4" 310 | source = "registry+https://github.com/rust-lang/crates.io-index" 311 | checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" 312 | dependencies = [ 313 | "lazy_static", 314 | "libc", 315 | "log", 316 | "openssl", 317 | "openssl-probe", 318 | "openssl-sys", 319 | "schannel", 320 | "security-framework", 321 | "security-framework-sys", 322 | "tempfile", 323 | ] 324 | 325 | [[package]] 326 | name = "nom" 327 | version = "4.2.3" 328 | source = "registry+https://github.com/rust-lang/crates.io-index" 329 | checksum = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" 330 | dependencies = [ 331 | "memchr", 332 | "version_check", 333 | ] 334 | 335 | [[package]] 336 | name = "num-integer" 337 | version = "0.1.42" 338 | source = "registry+https://github.com/rust-lang/crates.io-index" 339 | checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" 340 | dependencies = [ 341 | "autocfg 1.0.0", 342 | "num-traits", 343 | ] 344 | 345 | [[package]] 346 | name = "num-traits" 347 | version = "0.2.11" 348 | source = "registry+https://github.com/rust-lang/crates.io-index" 349 | checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" 350 | dependencies = [ 351 | "autocfg 1.0.0", 352 | ] 353 | 354 | [[package]] 355 | name = "openssl" 356 | version = "0.10.29" 357 | source = "registry+https://github.com/rust-lang/crates.io-index" 358 | checksum = "cee6d85f4cb4c4f59a6a85d5b68a233d280c82e29e822913b9c8b129fbf20bdd" 359 | dependencies = [ 360 | "bitflags", 361 | "cfg-if", 362 | "foreign-types", 363 | "lazy_static", 364 | "libc", 365 | "openssl-sys", 366 | ] 367 | 368 | [[package]] 369 | name = "openssl-probe" 370 | version = "0.1.2" 371 | source = "registry+https://github.com/rust-lang/crates.io-index" 372 | checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" 373 | 374 | [[package]] 375 | name = "openssl-sys" 376 | version = "0.9.56" 377 | source = "registry+https://github.com/rust-lang/crates.io-index" 378 | checksum = "f02309a7f127000ed50594f0b50ecc69e7c654e16d41b4e8156d1b3df8e0b52e" 379 | dependencies = [ 380 | "autocfg 1.0.0", 381 | "cc", 382 | "libc", 383 | "pkg-config", 384 | "vcpkg", 385 | ] 386 | 387 | [[package]] 388 | name = "pkg-config" 389 | version = "0.3.17" 390 | source = "registry+https://github.com/rust-lang/crates.io-index" 391 | checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" 392 | 393 | [[package]] 394 | name = "ppv-lite86" 395 | version = "0.2.6" 396 | source = "registry+https://github.com/rust-lang/crates.io-index" 397 | checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" 398 | 399 | [[package]] 400 | name = "proc-macro2" 401 | version = "1.0.12" 402 | source = "registry+https://github.com/rust-lang/crates.io-index" 403 | checksum = "8872cf6f48eee44265156c111456a700ab3483686b3f96df4cf5481c89157319" 404 | dependencies = [ 405 | "unicode-xid", 406 | ] 407 | 408 | [[package]] 409 | name = "quote" 410 | version = "1.0.4" 411 | source = "registry+https://github.com/rust-lang/crates.io-index" 412 | checksum = "4c1f4b0efa5fc5e8ceb705136bfee52cfdb6a4e3509f770b478cd6ed434232a7" 413 | dependencies = [ 414 | "proc-macro2", 415 | ] 416 | 417 | [[package]] 418 | name = "rand" 419 | version = "0.4.6" 420 | source = "registry+https://github.com/rust-lang/crates.io-index" 421 | checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" 422 | dependencies = [ 423 | "fuchsia-cprng", 424 | "libc", 425 | "rand_core 0.3.1", 426 | "rdrand", 427 | "winapi", 428 | ] 429 | 430 | [[package]] 431 | name = "rand" 432 | version = "0.6.5" 433 | source = "registry+https://github.com/rust-lang/crates.io-index" 434 | checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" 435 | dependencies = [ 436 | "autocfg 0.1.7", 437 | "libc", 438 | "rand_chacha 0.1.1", 439 | "rand_core 0.4.2", 440 | "rand_hc 0.1.0", 441 | "rand_isaac", 442 | "rand_jitter", 443 | "rand_os", 444 | "rand_pcg", 445 | "rand_xorshift", 446 | "winapi", 447 | ] 448 | 449 | [[package]] 450 | name = "rand" 451 | version = "0.7.3" 452 | source = "registry+https://github.com/rust-lang/crates.io-index" 453 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 454 | dependencies = [ 455 | "getrandom", 456 | "libc", 457 | "rand_chacha 0.2.2", 458 | "rand_core 0.5.1", 459 | "rand_hc 0.2.0", 460 | ] 461 | 462 | [[package]] 463 | name = "rand_chacha" 464 | version = "0.1.1" 465 | source = "registry+https://github.com/rust-lang/crates.io-index" 466 | checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" 467 | dependencies = [ 468 | "autocfg 0.1.7", 469 | "rand_core 0.3.1", 470 | ] 471 | 472 | [[package]] 473 | name = "rand_chacha" 474 | version = "0.2.2" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 477 | dependencies = [ 478 | "ppv-lite86", 479 | "rand_core 0.5.1", 480 | ] 481 | 482 | [[package]] 483 | name = "rand_core" 484 | version = "0.3.1" 485 | source = "registry+https://github.com/rust-lang/crates.io-index" 486 | checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" 487 | dependencies = [ 488 | "rand_core 0.4.2", 489 | ] 490 | 491 | [[package]] 492 | name = "rand_core" 493 | version = "0.4.2" 494 | source = "registry+https://github.com/rust-lang/crates.io-index" 495 | checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" 496 | 497 | [[package]] 498 | name = "rand_core" 499 | version = "0.5.1" 500 | source = "registry+https://github.com/rust-lang/crates.io-index" 501 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 502 | dependencies = [ 503 | "getrandom", 504 | ] 505 | 506 | [[package]] 507 | name = "rand_hc" 508 | version = "0.1.0" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" 511 | dependencies = [ 512 | "rand_core 0.3.1", 513 | ] 514 | 515 | [[package]] 516 | name = "rand_hc" 517 | version = "0.2.0" 518 | source = "registry+https://github.com/rust-lang/crates.io-index" 519 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 520 | dependencies = [ 521 | "rand_core 0.5.1", 522 | ] 523 | 524 | [[package]] 525 | name = "rand_isaac" 526 | version = "0.1.1" 527 | source = "registry+https://github.com/rust-lang/crates.io-index" 528 | checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" 529 | dependencies = [ 530 | "rand_core 0.3.1", 531 | ] 532 | 533 | [[package]] 534 | name = "rand_jitter" 535 | version = "0.1.4" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" 538 | dependencies = [ 539 | "libc", 540 | "rand_core 0.4.2", 541 | "winapi", 542 | ] 543 | 544 | [[package]] 545 | name = "rand_os" 546 | version = "0.1.3" 547 | source = "registry+https://github.com/rust-lang/crates.io-index" 548 | checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" 549 | dependencies = [ 550 | "cloudabi", 551 | "fuchsia-cprng", 552 | "libc", 553 | "rand_core 0.4.2", 554 | "rdrand", 555 | "winapi", 556 | ] 557 | 558 | [[package]] 559 | name = "rand_pcg" 560 | version = "0.1.2" 561 | source = "registry+https://github.com/rust-lang/crates.io-index" 562 | checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" 563 | dependencies = [ 564 | "autocfg 0.1.7", 565 | "rand_core 0.4.2", 566 | ] 567 | 568 | [[package]] 569 | name = "rand_xorshift" 570 | version = "0.1.1" 571 | source = "registry+https://github.com/rust-lang/crates.io-index" 572 | checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" 573 | dependencies = [ 574 | "rand_core 0.3.1", 575 | ] 576 | 577 | [[package]] 578 | name = "rdrand" 579 | version = "0.4.0" 580 | source = "registry+https://github.com/rust-lang/crates.io-index" 581 | checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" 582 | dependencies = [ 583 | "rand_core 0.3.1", 584 | ] 585 | 586 | [[package]] 587 | name = "redox_syscall" 588 | version = "0.1.56" 589 | source = "registry+https://github.com/rust-lang/crates.io-index" 590 | checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" 591 | 592 | [[package]] 593 | name = "remove_dir_all" 594 | version = "0.5.2" 595 | source = "registry+https://github.com/rust-lang/crates.io-index" 596 | checksum = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" 597 | dependencies = [ 598 | "winapi", 599 | ] 600 | 601 | [[package]] 602 | name = "ryu" 603 | version = "1.0.4" 604 | source = "registry+https://github.com/rust-lang/crates.io-index" 605 | checksum = "ed3d612bc64430efeb3f7ee6ef26d590dce0c43249217bddc62112540c7941e1" 606 | 607 | [[package]] 608 | name = "safemem" 609 | version = "0.3.3" 610 | source = "registry+https://github.com/rust-lang/crates.io-index" 611 | checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" 612 | 613 | [[package]] 614 | name = "schannel" 615 | version = "0.1.19" 616 | source = "registry+https://github.com/rust-lang/crates.io-index" 617 | checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" 618 | dependencies = [ 619 | "lazy_static", 620 | "winapi", 621 | ] 622 | 623 | [[package]] 624 | name = "security-framework" 625 | version = "0.4.4" 626 | source = "registry+https://github.com/rust-lang/crates.io-index" 627 | checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" 628 | dependencies = [ 629 | "bitflags", 630 | "core-foundation", 631 | "core-foundation-sys", 632 | "libc", 633 | "security-framework-sys", 634 | ] 635 | 636 | [[package]] 637 | name = "security-framework-sys" 638 | version = "0.4.3" 639 | source = "registry+https://github.com/rust-lang/crates.io-index" 640 | checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" 641 | dependencies = [ 642 | "core-foundation-sys", 643 | "libc", 644 | ] 645 | 646 | [[package]] 647 | name = "serde" 648 | version = "1.0.110" 649 | source = "registry+https://github.com/rust-lang/crates.io-index" 650 | checksum = "99e7b308464d16b56eba9964e4972a3eee817760ab60d88c3f86e1fecb08204c" 651 | 652 | [[package]] 653 | name = "serde_derive" 654 | version = "1.0.110" 655 | source = "registry+https://github.com/rust-lang/crates.io-index" 656 | checksum = "818fbf6bfa9a42d3bfcaca148547aa00c7b915bec71d1757aa2d44ca68771984" 657 | dependencies = [ 658 | "proc-macro2", 659 | "quote", 660 | "syn", 661 | ] 662 | 663 | [[package]] 664 | name = "serde_json" 665 | version = "1.0.53" 666 | source = "registry+https://github.com/rust-lang/crates.io-index" 667 | checksum = "993948e75b189211a9b31a7528f950c6adc21f9720b6438ff80a7fa2f864cea2" 668 | dependencies = [ 669 | "itoa", 670 | "ryu", 671 | "serde", 672 | ] 673 | 674 | [[package]] 675 | name = "syn" 676 | version = "1.0.19" 677 | source = "registry+https://github.com/rust-lang/crates.io-index" 678 | checksum = "e8e5aa70697bb26ee62214ae3288465ecec0000f05182f039b477001f08f5ae7" 679 | dependencies = [ 680 | "proc-macro2", 681 | "quote", 682 | "unicode-xid", 683 | ] 684 | 685 | [[package]] 686 | name = "tempfile" 687 | version = "3.1.0" 688 | source = "registry+https://github.com/rust-lang/crates.io-index" 689 | checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" 690 | dependencies = [ 691 | "cfg-if", 692 | "libc", 693 | "rand 0.7.3", 694 | "redox_syscall", 695 | "remove_dir_all", 696 | "winapi", 697 | ] 698 | 699 | [[package]] 700 | name = "time" 701 | version = "0.1.43" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" 704 | dependencies = [ 705 | "libc", 706 | "winapi", 707 | ] 708 | 709 | [[package]] 710 | name = "unicode-xid" 711 | version = "0.2.0" 712 | source = "registry+https://github.com/rust-lang/crates.io-index" 713 | checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 714 | 715 | [[package]] 716 | name = "use_lettre" 717 | version = "0.1.0" 718 | dependencies = [ 719 | "lettre", 720 | "lettre_email", 721 | ] 722 | 723 | [[package]] 724 | name = "uuid" 725 | version = "0.7.4" 726 | source = "registry+https://github.com/rust-lang/crates.io-index" 727 | checksum = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" 728 | dependencies = [ 729 | "rand 0.6.5", 730 | ] 731 | 732 | [[package]] 733 | name = "vcpkg" 734 | version = "0.2.8" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | checksum = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" 737 | 738 | [[package]] 739 | name = "version_check" 740 | version = "0.1.5" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" 743 | 744 | [[package]] 745 | name = "wasi" 746 | version = "0.9.0+wasi-snapshot-preview1" 747 | source = "registry+https://github.com/rust-lang/crates.io-index" 748 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 749 | 750 | [[package]] 751 | name = "winapi" 752 | version = "0.3.8" 753 | source = "registry+https://github.com/rust-lang/crates.io-index" 754 | checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 755 | dependencies = [ 756 | "winapi-i686-pc-windows-gnu", 757 | "winapi-x86_64-pc-windows-gnu", 758 | ] 759 | 760 | [[package]] 761 | name = "winapi-i686-pc-windows-gnu" 762 | version = "0.4.0" 763 | source = "registry+https://github.com/rust-lang/crates.io-index" 764 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 765 | 766 | [[package]] 767 | name = "winapi-x86_64-pc-windows-gnu" 768 | version = "0.4.0" 769 | source = "registry+https://github.com/rust-lang/crates.io-index" 770 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 771 | 772 | [[package]] 773 | name = "winutil" 774 | version = "0.1.1" 775 | source = "registry+https://github.com/rust-lang/crates.io-index" 776 | checksum = "7daf138b6b14196e3830a588acf1e86966c694d3e8fb026fb105b8b5dca07e6e" 777 | dependencies = [ 778 | "winapi", 779 | ] 780 | -------------------------------------------------------------------------------- /use_dns/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "autocfg" 5 | version = "0.1.7" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" 8 | 9 | [[package]] 10 | name = "autocfg" 11 | version = "1.0.0" 12 | source = "registry+https://github.com/rust-lang/crates.io-index" 13 | checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 14 | 15 | [[package]] 16 | name = "backtrace" 17 | version = "0.3.46" 18 | source = "registry+https://github.com/rust-lang/crates.io-index" 19 | checksum = "b1e692897359247cc6bb902933361652380af0f1b7651ae5c5013407f30e109e" 20 | dependencies = [ 21 | "backtrace-sys", 22 | "cfg-if", 23 | "libc", 24 | "rustc-demangle", 25 | ] 26 | 27 | [[package]] 28 | name = "backtrace-sys" 29 | version = "0.1.37" 30 | source = "registry+https://github.com/rust-lang/crates.io-index" 31 | checksum = "18fbebbe1c9d1f383a9cc7e8ccdb471b91c8d024ee9c2ca5b5346121fe8b4399" 32 | dependencies = [ 33 | "cc", 34 | "libc", 35 | ] 36 | 37 | [[package]] 38 | name = "bitflags" 39 | version = "1.2.1" 40 | source = "registry+https://github.com/rust-lang/crates.io-index" 41 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 42 | 43 | [[package]] 44 | name = "byteorder" 45 | version = "1.3.4" 46 | source = "registry+https://github.com/rust-lang/crates.io-index" 47 | checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" 48 | 49 | [[package]] 50 | name = "bytes" 51 | version = "0.4.12" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" 54 | dependencies = [ 55 | "byteorder", 56 | "iovec", 57 | ] 58 | 59 | [[package]] 60 | name = "cc" 61 | version = "1.0.52" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "c3d87b23d6a92cd03af510a5ade527033f6aa6fa92161e2d5863a907d4c5e31d" 64 | 65 | [[package]] 66 | name = "cfg-if" 67 | version = "0.1.10" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 70 | 71 | [[package]] 72 | name = "chrono" 73 | version = "0.4.11" 74 | source = "registry+https://github.com/rust-lang/crates.io-index" 75 | checksum = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2" 76 | dependencies = [ 77 | "num-integer", 78 | "num-traits", 79 | "time", 80 | ] 81 | 82 | [[package]] 83 | name = "cloudabi" 84 | version = "0.0.3" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" 87 | dependencies = [ 88 | "bitflags", 89 | ] 90 | 91 | [[package]] 92 | name = "crossbeam-deque" 93 | version = "0.7.3" 94 | source = "registry+https://github.com/rust-lang/crates.io-index" 95 | checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" 96 | dependencies = [ 97 | "crossbeam-epoch", 98 | "crossbeam-utils", 99 | "maybe-uninit", 100 | ] 101 | 102 | [[package]] 103 | name = "crossbeam-epoch" 104 | version = "0.8.2" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" 107 | dependencies = [ 108 | "autocfg 1.0.0", 109 | "cfg-if", 110 | "crossbeam-utils", 111 | "lazy_static", 112 | "maybe-uninit", 113 | "memoffset", 114 | "scopeguard", 115 | ] 116 | 117 | [[package]] 118 | name = "crossbeam-queue" 119 | version = "0.2.1" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" 122 | dependencies = [ 123 | "cfg-if", 124 | "crossbeam-utils", 125 | ] 126 | 127 | [[package]] 128 | name = "crossbeam-utils" 129 | version = "0.7.2" 130 | source = "registry+https://github.com/rust-lang/crates.io-index" 131 | checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" 132 | dependencies = [ 133 | "autocfg 1.0.0", 134 | "cfg-if", 135 | "lazy_static", 136 | ] 137 | 138 | [[package]] 139 | name = "data-encoding" 140 | version = "2.2.0" 141 | source = "registry+https://github.com/rust-lang/crates.io-index" 142 | checksum = "11c0346158a19b3627234e15596f5e465c360fcdb97d817bcb255e0510f5a788" 143 | 144 | [[package]] 145 | name = "data-encoding-macro" 146 | version = "0.1.8" 147 | source = "registry+https://github.com/rust-lang/crates.io-index" 148 | checksum = "de6489dde5128f5ab2f71f88f8807a237cecf08d96dc7ca4be64e0730dc7d961" 149 | dependencies = [ 150 | "data-encoding", 151 | "data-encoding-macro-internal", 152 | "proc-macro-hack", 153 | ] 154 | 155 | [[package]] 156 | name = "data-encoding-macro-internal" 157 | version = "0.1.8" 158 | source = "registry+https://github.com/rust-lang/crates.io-index" 159 | checksum = "8d2d6daefd5f1d4b74a891a5d2ab7dccba028d423107c074232a0c5dc0d40a9e" 160 | dependencies = [ 161 | "data-encoding", 162 | "proc-macro-hack", 163 | "syn 1.0.18", 164 | ] 165 | 166 | [[package]] 167 | name = "endian-type" 168 | version = "0.1.2" 169 | source = "registry+https://github.com/rust-lang/crates.io-index" 170 | checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" 171 | 172 | [[package]] 173 | name = "enum-as-inner" 174 | version = "0.2.1" 175 | source = "registry+https://github.com/rust-lang/crates.io-index" 176 | checksum = "3d58266c97445680766be408285e798d3401c6d4c378ec5552e78737e681e37d" 177 | dependencies = [ 178 | "proc-macro2 0.4.30", 179 | "quote 0.6.13", 180 | "syn 0.15.44", 181 | ] 182 | 183 | [[package]] 184 | name = "failure" 185 | version = "0.1.8" 186 | source = "registry+https://github.com/rust-lang/crates.io-index" 187 | checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" 188 | dependencies = [ 189 | "backtrace", 190 | "failure_derive", 191 | ] 192 | 193 | [[package]] 194 | name = "failure_derive" 195 | version = "0.1.8" 196 | source = "registry+https://github.com/rust-lang/crates.io-index" 197 | checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" 198 | dependencies = [ 199 | "proc-macro2 1.0.12", 200 | "quote 1.0.4", 201 | "syn 1.0.18", 202 | "synstructure", 203 | ] 204 | 205 | [[package]] 206 | name = "fnv" 207 | version = "1.0.6" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" 210 | 211 | [[package]] 212 | name = "fuchsia-cprng" 213 | version = "0.1.1" 214 | source = "registry+https://github.com/rust-lang/crates.io-index" 215 | checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" 216 | 217 | [[package]] 218 | name = "fuchsia-zircon" 219 | version = "0.3.3" 220 | source = "registry+https://github.com/rust-lang/crates.io-index" 221 | checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" 222 | dependencies = [ 223 | "bitflags", 224 | "fuchsia-zircon-sys", 225 | ] 226 | 227 | [[package]] 228 | name = "fuchsia-zircon-sys" 229 | version = "0.3.3" 230 | source = "registry+https://github.com/rust-lang/crates.io-index" 231 | checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" 232 | 233 | [[package]] 234 | name = "futures" 235 | version = "0.1.29" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" 238 | 239 | [[package]] 240 | name = "hermit-abi" 241 | version = "0.1.12" 242 | source = "registry+https://github.com/rust-lang/crates.io-index" 243 | checksum = "61565ff7aaace3525556587bd2dc31d4a07071957be715e63ce7b1eccf51a8f4" 244 | dependencies = [ 245 | "libc", 246 | ] 247 | 248 | [[package]] 249 | name = "hostname" 250 | version = "0.3.1" 251 | source = "registry+https://github.com/rust-lang/crates.io-index" 252 | checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" 253 | dependencies = [ 254 | "libc", 255 | "match_cfg", 256 | "winapi 0.3.8", 257 | ] 258 | 259 | [[package]] 260 | name = "idna" 261 | version = "0.1.5" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" 264 | dependencies = [ 265 | "matches", 266 | "unicode-bidi", 267 | "unicode-normalization", 268 | ] 269 | 270 | [[package]] 271 | name = "iovec" 272 | version = "0.1.4" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 275 | dependencies = [ 276 | "libc", 277 | ] 278 | 279 | [[package]] 280 | name = "ipconfig" 281 | version = "0.2.2" 282 | source = "registry+https://github.com/rust-lang/crates.io-index" 283 | checksum = "f7e2f18aece9709094573a9f24f483c4f65caa4298e2f7ae1b71cc65d853fad7" 284 | dependencies = [ 285 | "socket2", 286 | "widestring", 287 | "winapi 0.3.8", 288 | "winreg", 289 | ] 290 | 291 | [[package]] 292 | name = "kernel32-sys" 293 | version = "0.2.2" 294 | source = "registry+https://github.com/rust-lang/crates.io-index" 295 | checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" 296 | dependencies = [ 297 | "winapi 0.2.8", 298 | "winapi-build", 299 | ] 300 | 301 | [[package]] 302 | name = "lazy_static" 303 | version = "1.4.0" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 306 | 307 | [[package]] 308 | name = "libc" 309 | version = "0.2.69" 310 | source = "registry+https://github.com/rust-lang/crates.io-index" 311 | checksum = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005" 312 | 313 | [[package]] 314 | name = "linked-hash-map" 315 | version = "0.5.2" 316 | source = "registry+https://github.com/rust-lang/crates.io-index" 317 | checksum = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83" 318 | 319 | [[package]] 320 | name = "lock_api" 321 | version = "0.3.4" 322 | source = "registry+https://github.com/rust-lang/crates.io-index" 323 | checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" 324 | dependencies = [ 325 | "scopeguard", 326 | ] 327 | 328 | [[package]] 329 | name = "log" 330 | version = "0.4.8" 331 | source = "registry+https://github.com/rust-lang/crates.io-index" 332 | checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" 333 | dependencies = [ 334 | "cfg-if", 335 | ] 336 | 337 | [[package]] 338 | name = "lru-cache" 339 | version = "0.1.2" 340 | source = "registry+https://github.com/rust-lang/crates.io-index" 341 | checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" 342 | dependencies = [ 343 | "linked-hash-map", 344 | ] 345 | 346 | [[package]] 347 | name = "match_cfg" 348 | version = "0.1.0" 349 | source = "registry+https://github.com/rust-lang/crates.io-index" 350 | checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" 351 | 352 | [[package]] 353 | name = "matches" 354 | version = "0.1.8" 355 | source = "registry+https://github.com/rust-lang/crates.io-index" 356 | checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 357 | 358 | [[package]] 359 | name = "maybe-uninit" 360 | version = "2.0.0" 361 | source = "registry+https://github.com/rust-lang/crates.io-index" 362 | checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" 363 | 364 | [[package]] 365 | name = "memoffset" 366 | version = "0.5.4" 367 | source = "registry+https://github.com/rust-lang/crates.io-index" 368 | checksum = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" 369 | dependencies = [ 370 | "autocfg 1.0.0", 371 | ] 372 | 373 | [[package]] 374 | name = "mio" 375 | version = "0.6.22" 376 | source = "registry+https://github.com/rust-lang/crates.io-index" 377 | checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" 378 | dependencies = [ 379 | "cfg-if", 380 | "fuchsia-zircon", 381 | "fuchsia-zircon-sys", 382 | "iovec", 383 | "kernel32-sys", 384 | "libc", 385 | "log", 386 | "miow", 387 | "net2", 388 | "slab", 389 | "winapi 0.2.8", 390 | ] 391 | 392 | [[package]] 393 | name = "mio-uds" 394 | version = "0.6.8" 395 | source = "registry+https://github.com/rust-lang/crates.io-index" 396 | checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" 397 | dependencies = [ 398 | "iovec", 399 | "libc", 400 | "mio", 401 | ] 402 | 403 | [[package]] 404 | name = "miow" 405 | version = "0.2.1" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" 408 | dependencies = [ 409 | "kernel32-sys", 410 | "net2", 411 | "winapi 0.2.8", 412 | "ws2_32-sys", 413 | ] 414 | 415 | [[package]] 416 | name = "net2" 417 | version = "0.2.34" 418 | source = "registry+https://github.com/rust-lang/crates.io-index" 419 | checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" 420 | dependencies = [ 421 | "cfg-if", 422 | "libc", 423 | "winapi 0.3.8", 424 | ] 425 | 426 | [[package]] 427 | name = "nibble_vec" 428 | version = "0.0.4" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | checksum = "c8d77f3db4bce033f4d04db08079b2ef1c3d02b44e86f25d08886fafa7756ffa" 431 | 432 | [[package]] 433 | name = "num-integer" 434 | version = "0.1.42" 435 | source = "registry+https://github.com/rust-lang/crates.io-index" 436 | checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" 437 | dependencies = [ 438 | "autocfg 1.0.0", 439 | "num-traits", 440 | ] 441 | 442 | [[package]] 443 | name = "num-traits" 444 | version = "0.2.11" 445 | source = "registry+https://github.com/rust-lang/crates.io-index" 446 | checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" 447 | dependencies = [ 448 | "autocfg 1.0.0", 449 | ] 450 | 451 | [[package]] 452 | name = "num_cpus" 453 | version = "1.13.0" 454 | source = "registry+https://github.com/rust-lang/crates.io-index" 455 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 456 | dependencies = [ 457 | "hermit-abi", 458 | "libc", 459 | ] 460 | 461 | [[package]] 462 | name = "parking_lot" 463 | version = "0.9.0" 464 | source = "registry+https://github.com/rust-lang/crates.io-index" 465 | checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" 466 | dependencies = [ 467 | "lock_api", 468 | "parking_lot_core", 469 | "rustc_version", 470 | ] 471 | 472 | [[package]] 473 | name = "parking_lot_core" 474 | version = "0.6.2" 475 | source = "registry+https://github.com/rust-lang/crates.io-index" 476 | checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" 477 | dependencies = [ 478 | "cfg-if", 479 | "cloudabi", 480 | "libc", 481 | "redox_syscall", 482 | "rustc_version", 483 | "smallvec 0.6.13", 484 | "winapi 0.3.8", 485 | ] 486 | 487 | [[package]] 488 | name = "percent-encoding" 489 | version = "1.0.1" 490 | source = "registry+https://github.com/rust-lang/crates.io-index" 491 | checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" 492 | 493 | [[package]] 494 | name = "proc-macro-hack" 495 | version = "0.5.15" 496 | source = "registry+https://github.com/rust-lang/crates.io-index" 497 | checksum = "0d659fe7c6d27f25e9d80a1a094c223f5246f6a6596453e09d7229bf42750b63" 498 | 499 | [[package]] 500 | name = "proc-macro2" 501 | version = "0.4.30" 502 | source = "registry+https://github.com/rust-lang/crates.io-index" 503 | checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" 504 | dependencies = [ 505 | "unicode-xid 0.1.0", 506 | ] 507 | 508 | [[package]] 509 | name = "proc-macro2" 510 | version = "1.0.12" 511 | source = "registry+https://github.com/rust-lang/crates.io-index" 512 | checksum = "8872cf6f48eee44265156c111456a700ab3483686b3f96df4cf5481c89157319" 513 | dependencies = [ 514 | "unicode-xid 0.2.0", 515 | ] 516 | 517 | [[package]] 518 | name = "quick-error" 519 | version = "1.2.3" 520 | source = "registry+https://github.com/rust-lang/crates.io-index" 521 | checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" 522 | 523 | [[package]] 524 | name = "quote" 525 | version = "0.6.13" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" 528 | dependencies = [ 529 | "proc-macro2 0.4.30", 530 | ] 531 | 532 | [[package]] 533 | name = "quote" 534 | version = "1.0.4" 535 | source = "registry+https://github.com/rust-lang/crates.io-index" 536 | checksum = "4c1f4b0efa5fc5e8ceb705136bfee52cfdb6a4e3509f770b478cd6ed434232a7" 537 | dependencies = [ 538 | "proc-macro2 1.0.12", 539 | ] 540 | 541 | [[package]] 542 | name = "radix_trie" 543 | version = "0.1.6" 544 | source = "registry+https://github.com/rust-lang/crates.io-index" 545 | checksum = "3d3681b28cd95acfb0560ea9441f82d6a4504fa3b15b97bd7b6e952131820e95" 546 | dependencies = [ 547 | "endian-type", 548 | "nibble_vec", 549 | ] 550 | 551 | [[package]] 552 | name = "rand" 553 | version = "0.6.5" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" 556 | dependencies = [ 557 | "autocfg 0.1.7", 558 | "libc", 559 | "rand_chacha", 560 | "rand_core 0.4.2", 561 | "rand_hc", 562 | "rand_isaac", 563 | "rand_jitter", 564 | "rand_os", 565 | "rand_pcg", 566 | "rand_xorshift", 567 | "winapi 0.3.8", 568 | ] 569 | 570 | [[package]] 571 | name = "rand_chacha" 572 | version = "0.1.1" 573 | source = "registry+https://github.com/rust-lang/crates.io-index" 574 | checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" 575 | dependencies = [ 576 | "autocfg 0.1.7", 577 | "rand_core 0.3.1", 578 | ] 579 | 580 | [[package]] 581 | name = "rand_core" 582 | version = "0.3.1" 583 | source = "registry+https://github.com/rust-lang/crates.io-index" 584 | checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" 585 | dependencies = [ 586 | "rand_core 0.4.2", 587 | ] 588 | 589 | [[package]] 590 | name = "rand_core" 591 | version = "0.4.2" 592 | source = "registry+https://github.com/rust-lang/crates.io-index" 593 | checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" 594 | 595 | [[package]] 596 | name = "rand_hc" 597 | version = "0.1.0" 598 | source = "registry+https://github.com/rust-lang/crates.io-index" 599 | checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" 600 | dependencies = [ 601 | "rand_core 0.3.1", 602 | ] 603 | 604 | [[package]] 605 | name = "rand_isaac" 606 | version = "0.1.1" 607 | source = "registry+https://github.com/rust-lang/crates.io-index" 608 | checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" 609 | dependencies = [ 610 | "rand_core 0.3.1", 611 | ] 612 | 613 | [[package]] 614 | name = "rand_jitter" 615 | version = "0.1.4" 616 | source = "registry+https://github.com/rust-lang/crates.io-index" 617 | checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" 618 | dependencies = [ 619 | "libc", 620 | "rand_core 0.4.2", 621 | "winapi 0.3.8", 622 | ] 623 | 624 | [[package]] 625 | name = "rand_os" 626 | version = "0.1.3" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" 629 | dependencies = [ 630 | "cloudabi", 631 | "fuchsia-cprng", 632 | "libc", 633 | "rand_core 0.4.2", 634 | "rdrand", 635 | "winapi 0.3.8", 636 | ] 637 | 638 | [[package]] 639 | name = "rand_pcg" 640 | version = "0.1.2" 641 | source = "registry+https://github.com/rust-lang/crates.io-index" 642 | checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" 643 | dependencies = [ 644 | "autocfg 0.1.7", 645 | "rand_core 0.4.2", 646 | ] 647 | 648 | [[package]] 649 | name = "rand_xorshift" 650 | version = "0.1.1" 651 | source = "registry+https://github.com/rust-lang/crates.io-index" 652 | checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" 653 | dependencies = [ 654 | "rand_core 0.3.1", 655 | ] 656 | 657 | [[package]] 658 | name = "rdrand" 659 | version = "0.4.0" 660 | source = "registry+https://github.com/rust-lang/crates.io-index" 661 | checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" 662 | dependencies = [ 663 | "rand_core 0.3.1", 664 | ] 665 | 666 | [[package]] 667 | name = "redox_syscall" 668 | version = "0.1.56" 669 | source = "registry+https://github.com/rust-lang/crates.io-index" 670 | checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" 671 | 672 | [[package]] 673 | name = "resolv-conf" 674 | version = "0.6.3" 675 | source = "registry+https://github.com/rust-lang/crates.io-index" 676 | checksum = "11834e137f3b14e309437a8276714eed3a80d1ef894869e510f2c0c0b98b9f4a" 677 | dependencies = [ 678 | "hostname", 679 | "quick-error", 680 | ] 681 | 682 | [[package]] 683 | name = "rustc-demangle" 684 | version = "0.1.16" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" 687 | 688 | [[package]] 689 | name = "rustc_version" 690 | version = "0.2.3" 691 | source = "registry+https://github.com/rust-lang/crates.io-index" 692 | checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 693 | dependencies = [ 694 | "semver", 695 | ] 696 | 697 | [[package]] 698 | name = "scopeguard" 699 | version = "1.1.0" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 702 | 703 | [[package]] 704 | name = "semver" 705 | version = "0.9.0" 706 | source = "registry+https://github.com/rust-lang/crates.io-index" 707 | checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 708 | dependencies = [ 709 | "semver-parser", 710 | ] 711 | 712 | [[package]] 713 | name = "semver-parser" 714 | version = "0.7.0" 715 | source = "registry+https://github.com/rust-lang/crates.io-index" 716 | checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 717 | 718 | [[package]] 719 | name = "slab" 720 | version = "0.4.2" 721 | source = "registry+https://github.com/rust-lang/crates.io-index" 722 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 723 | 724 | [[package]] 725 | name = "smallvec" 726 | version = "0.6.13" 727 | source = "registry+https://github.com/rust-lang/crates.io-index" 728 | checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" 729 | dependencies = [ 730 | "maybe-uninit", 731 | ] 732 | 733 | [[package]] 734 | name = "smallvec" 735 | version = "1.4.0" 736 | source = "registry+https://github.com/rust-lang/crates.io-index" 737 | checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" 738 | 739 | [[package]] 740 | name = "socket2" 741 | version = "0.3.12" 742 | source = "registry+https://github.com/rust-lang/crates.io-index" 743 | checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" 744 | dependencies = [ 745 | "cfg-if", 746 | "libc", 747 | "redox_syscall", 748 | "winapi 0.3.8", 749 | ] 750 | 751 | [[package]] 752 | name = "syn" 753 | version = "0.15.44" 754 | source = "registry+https://github.com/rust-lang/crates.io-index" 755 | checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" 756 | dependencies = [ 757 | "proc-macro2 0.4.30", 758 | "quote 0.6.13", 759 | "unicode-xid 0.1.0", 760 | ] 761 | 762 | [[package]] 763 | name = "syn" 764 | version = "1.0.18" 765 | source = "registry+https://github.com/rust-lang/crates.io-index" 766 | checksum = "410a7488c0a728c7ceb4ad59b9567eb4053d02e8cc7f5c0e0eeeb39518369213" 767 | dependencies = [ 768 | "proc-macro2 1.0.12", 769 | "quote 1.0.4", 770 | "unicode-xid 0.2.0", 771 | ] 772 | 773 | [[package]] 774 | name = "synstructure" 775 | version = "0.12.3" 776 | source = "registry+https://github.com/rust-lang/crates.io-index" 777 | checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" 778 | dependencies = [ 779 | "proc-macro2 1.0.12", 780 | "quote 1.0.4", 781 | "syn 1.0.18", 782 | "unicode-xid 0.2.0", 783 | ] 784 | 785 | [[package]] 786 | name = "time" 787 | version = "0.1.43" 788 | source = "registry+https://github.com/rust-lang/crates.io-index" 789 | checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" 790 | dependencies = [ 791 | "libc", 792 | "winapi 0.3.8", 793 | ] 794 | 795 | [[package]] 796 | name = "tokio" 797 | version = "0.1.22" 798 | source = "registry+https://github.com/rust-lang/crates.io-index" 799 | checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" 800 | dependencies = [ 801 | "bytes", 802 | "futures", 803 | "mio", 804 | "num_cpus", 805 | "tokio-codec", 806 | "tokio-current-thread", 807 | "tokio-executor", 808 | "tokio-fs", 809 | "tokio-io", 810 | "tokio-reactor", 811 | "tokio-sync", 812 | "tokio-tcp", 813 | "tokio-threadpool", 814 | "tokio-timer", 815 | "tokio-udp", 816 | "tokio-uds", 817 | ] 818 | 819 | [[package]] 820 | name = "tokio-codec" 821 | version = "0.1.2" 822 | source = "registry+https://github.com/rust-lang/crates.io-index" 823 | checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" 824 | dependencies = [ 825 | "bytes", 826 | "futures", 827 | "tokio-io", 828 | ] 829 | 830 | [[package]] 831 | name = "tokio-current-thread" 832 | version = "0.1.7" 833 | source = "registry+https://github.com/rust-lang/crates.io-index" 834 | checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" 835 | dependencies = [ 836 | "futures", 837 | "tokio-executor", 838 | ] 839 | 840 | [[package]] 841 | name = "tokio-executor" 842 | version = "0.1.10" 843 | source = "registry+https://github.com/rust-lang/crates.io-index" 844 | checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" 845 | dependencies = [ 846 | "crossbeam-utils", 847 | "futures", 848 | ] 849 | 850 | [[package]] 851 | name = "tokio-fs" 852 | version = "0.1.7" 853 | source = "registry+https://github.com/rust-lang/crates.io-index" 854 | checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" 855 | dependencies = [ 856 | "futures", 857 | "tokio-io", 858 | "tokio-threadpool", 859 | ] 860 | 861 | [[package]] 862 | name = "tokio-io" 863 | version = "0.1.13" 864 | source = "registry+https://github.com/rust-lang/crates.io-index" 865 | checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" 866 | dependencies = [ 867 | "bytes", 868 | "futures", 869 | "log", 870 | ] 871 | 872 | [[package]] 873 | name = "tokio-reactor" 874 | version = "0.1.12" 875 | source = "registry+https://github.com/rust-lang/crates.io-index" 876 | checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" 877 | dependencies = [ 878 | "crossbeam-utils", 879 | "futures", 880 | "lazy_static", 881 | "log", 882 | "mio", 883 | "num_cpus", 884 | "parking_lot", 885 | "slab", 886 | "tokio-executor", 887 | "tokio-io", 888 | "tokio-sync", 889 | ] 890 | 891 | [[package]] 892 | name = "tokio-sync" 893 | version = "0.1.8" 894 | source = "registry+https://github.com/rust-lang/crates.io-index" 895 | checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" 896 | dependencies = [ 897 | "fnv", 898 | "futures", 899 | ] 900 | 901 | [[package]] 902 | name = "tokio-tcp" 903 | version = "0.1.4" 904 | source = "registry+https://github.com/rust-lang/crates.io-index" 905 | checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" 906 | dependencies = [ 907 | "bytes", 908 | "futures", 909 | "iovec", 910 | "mio", 911 | "tokio-io", 912 | "tokio-reactor", 913 | ] 914 | 915 | [[package]] 916 | name = "tokio-threadpool" 917 | version = "0.1.18" 918 | source = "registry+https://github.com/rust-lang/crates.io-index" 919 | checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" 920 | dependencies = [ 921 | "crossbeam-deque", 922 | "crossbeam-queue", 923 | "crossbeam-utils", 924 | "futures", 925 | "lazy_static", 926 | "log", 927 | "num_cpus", 928 | "slab", 929 | "tokio-executor", 930 | ] 931 | 932 | [[package]] 933 | name = "tokio-timer" 934 | version = "0.2.13" 935 | source = "registry+https://github.com/rust-lang/crates.io-index" 936 | checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" 937 | dependencies = [ 938 | "crossbeam-utils", 939 | "futures", 940 | "slab", 941 | "tokio-executor", 942 | ] 943 | 944 | [[package]] 945 | name = "tokio-udp" 946 | version = "0.1.6" 947 | source = "registry+https://github.com/rust-lang/crates.io-index" 948 | checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" 949 | dependencies = [ 950 | "bytes", 951 | "futures", 952 | "log", 953 | "mio", 954 | "tokio-codec", 955 | "tokio-io", 956 | "tokio-reactor", 957 | ] 958 | 959 | [[package]] 960 | name = "tokio-uds" 961 | version = "0.2.6" 962 | source = "registry+https://github.com/rust-lang/crates.io-index" 963 | checksum = "5076db410d6fdc6523df7595447629099a1fdc47b3d9f896220780fa48faf798" 964 | dependencies = [ 965 | "bytes", 966 | "futures", 967 | "iovec", 968 | "libc", 969 | "log", 970 | "mio", 971 | "mio-uds", 972 | "tokio-codec", 973 | "tokio-io", 974 | "tokio-reactor", 975 | ] 976 | 977 | [[package]] 978 | name = "trust-dns" 979 | version = "0.16.1" 980 | source = "registry+https://github.com/rust-lang/crates.io-index" 981 | checksum = "462fc8356633e344a3ba4db3ef2d293dbb6eb7f3abc74f0f7986c3bbb049c8bb" 982 | dependencies = [ 983 | "chrono", 984 | "data-encoding", 985 | "data-encoding-macro", 986 | "failure", 987 | "futures", 988 | "lazy_static", 989 | "log", 990 | "radix_trie", 991 | "rand", 992 | "tokio", 993 | "tokio-tcp", 994 | "trust-dns-proto", 995 | ] 996 | 997 | [[package]] 998 | name = "trust-dns-proto" 999 | version = "0.7.4" 1000 | source = "registry+https://github.com/rust-lang/crates.io-index" 1001 | checksum = "5559ebdf6c2368ddd11e20b11d6bbaf9e46deb803acd7815e93f5a7b4a6d2901" 1002 | dependencies = [ 1003 | "byteorder", 1004 | "data-encoding", 1005 | "enum-as-inner", 1006 | "failure", 1007 | "futures", 1008 | "idna", 1009 | "lazy_static", 1010 | "log", 1011 | "rand", 1012 | "smallvec 0.6.13", 1013 | "socket2", 1014 | "tokio-executor", 1015 | "tokio-io", 1016 | "tokio-reactor", 1017 | "tokio-tcp", 1018 | "tokio-timer", 1019 | "tokio-udp", 1020 | "url", 1021 | ] 1022 | 1023 | [[package]] 1024 | name = "trust-dns-resolver" 1025 | version = "0.11.1" 1026 | source = "registry+https://github.com/rust-lang/crates.io-index" 1027 | checksum = "6c9992e58dba365798803c0b91018ff6c8d3fc77e06977c4539af2a6bfe0a039" 1028 | dependencies = [ 1029 | "cfg-if", 1030 | "failure", 1031 | "futures", 1032 | "ipconfig", 1033 | "lazy_static", 1034 | "log", 1035 | "lru-cache", 1036 | "resolv-conf", 1037 | "smallvec 0.6.13", 1038 | "tokio", 1039 | "tokio-executor", 1040 | "trust-dns-proto", 1041 | ] 1042 | 1043 | [[package]] 1044 | name = "unicode-bidi" 1045 | version = "0.3.4" 1046 | source = "registry+https://github.com/rust-lang/crates.io-index" 1047 | checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 1048 | dependencies = [ 1049 | "matches", 1050 | ] 1051 | 1052 | [[package]] 1053 | name = "unicode-normalization" 1054 | version = "0.1.12" 1055 | source = "registry+https://github.com/rust-lang/crates.io-index" 1056 | checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" 1057 | dependencies = [ 1058 | "smallvec 1.4.0", 1059 | ] 1060 | 1061 | [[package]] 1062 | name = "unicode-xid" 1063 | version = "0.1.0" 1064 | source = "registry+https://github.com/rust-lang/crates.io-index" 1065 | checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" 1066 | 1067 | [[package]] 1068 | name = "unicode-xid" 1069 | version = "0.2.0" 1070 | source = "registry+https://github.com/rust-lang/crates.io-index" 1071 | checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 1072 | 1073 | [[package]] 1074 | name = "url" 1075 | version = "1.7.2" 1076 | source = "registry+https://github.com/rust-lang/crates.io-index" 1077 | checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" 1078 | dependencies = [ 1079 | "idna", 1080 | "matches", 1081 | "percent-encoding", 1082 | ] 1083 | 1084 | [[package]] 1085 | name = "use_dns" 1086 | version = "0.1.0" 1087 | dependencies = [ 1088 | "trust-dns", 1089 | "trust-dns-resolver", 1090 | ] 1091 | 1092 | [[package]] 1093 | name = "widestring" 1094 | version = "0.4.0" 1095 | source = "registry+https://github.com/rust-lang/crates.io-index" 1096 | checksum = "effc0e4ff8085673ea7b9b2e3c73f6bd4d118810c9009ed8f1e16bd96c331db6" 1097 | 1098 | [[package]] 1099 | name = "winapi" 1100 | version = "0.2.8" 1101 | source = "registry+https://github.com/rust-lang/crates.io-index" 1102 | checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" 1103 | 1104 | [[package]] 1105 | name = "winapi" 1106 | version = "0.3.8" 1107 | source = "registry+https://github.com/rust-lang/crates.io-index" 1108 | checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" 1109 | dependencies = [ 1110 | "winapi-i686-pc-windows-gnu", 1111 | "winapi-x86_64-pc-windows-gnu", 1112 | ] 1113 | 1114 | [[package]] 1115 | name = "winapi-build" 1116 | version = "0.1.1" 1117 | source = "registry+https://github.com/rust-lang/crates.io-index" 1118 | checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" 1119 | 1120 | [[package]] 1121 | name = "winapi-i686-pc-windows-gnu" 1122 | version = "0.4.0" 1123 | source = "registry+https://github.com/rust-lang/crates.io-index" 1124 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1125 | 1126 | [[package]] 1127 | name = "winapi-x86_64-pc-windows-gnu" 1128 | version = "0.4.0" 1129 | source = "registry+https://github.com/rust-lang/crates.io-index" 1130 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1131 | 1132 | [[package]] 1133 | name = "winreg" 1134 | version = "0.6.2" 1135 | source = "registry+https://github.com/rust-lang/crates.io-index" 1136 | checksum = "b2986deb581c4fe11b621998a5e53361efe6b48a151178d0cd9eeffa4dc6acc9" 1137 | dependencies = [ 1138 | "winapi 0.3.8", 1139 | ] 1140 | 1141 | [[package]] 1142 | name = "ws2_32-sys" 1143 | version = "0.2.1" 1144 | source = "registry+https://github.com/rust-lang/crates.io-index" 1145 | checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" 1146 | dependencies = [ 1147 | "winapi 0.2.8", 1148 | "winapi-build", 1149 | ] 1150 | -------------------------------------------------------------------------------- /use_grpc/src/foobar.rs: -------------------------------------------------------------------------------- 1 | // This file is generated by rust-protobuf 2.14.0. Do not edit 2 | // @generated 3 | 4 | // https://github.com/rust-lang/rust-clippy/issues/702 5 | #![allow(unknown_lints)] 6 | #![allow(clippy::all)] 7 | 8 | #![cfg_attr(rustfmt, rustfmt_skip)] 9 | 10 | #![allow(box_pointers)] 11 | #![allow(dead_code)] 12 | #![allow(missing_docs)] 13 | #![allow(non_camel_case_types)] 14 | #![allow(non_snake_case)] 15 | #![allow(non_upper_case_globals)] 16 | #![allow(trivial_casts)] 17 | #![allow(unsafe_code)] 18 | #![allow(unused_imports)] 19 | #![allow(unused_results)] 20 | //! Generated file from `foobar.proto` 21 | 22 | use protobuf::Message as Message_imported_for_functions; 23 | use protobuf::ProtobufEnum as ProtobufEnum_imported_for_functions; 24 | 25 | /// Generated files are compatible only with the same version 26 | /// of protobuf runtime. 27 | // const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_14_0; 28 | 29 | #[derive(PartialEq,Clone,Default)] 30 | pub struct CabLocationRequest { 31 | // message fields 32 | pub name: ::std::string::String, 33 | pub location: ::protobuf::SingularPtrField, 34 | // special fields 35 | pub unknown_fields: ::protobuf::UnknownFields, 36 | pub cached_size: ::protobuf::CachedSize, 37 | } 38 | 39 | impl<'a> ::std::default::Default for &'a CabLocationRequest { 40 | fn default() -> &'a CabLocationRequest { 41 | ::default_instance() 42 | } 43 | } 44 | 45 | impl CabLocationRequest { 46 | pub fn new() -> CabLocationRequest { 47 | ::std::default::Default::default() 48 | } 49 | 50 | // string name = 1; 51 | 52 | 53 | pub fn get_name(&self) -> &str { 54 | &self.name 55 | } 56 | pub fn clear_name(&mut self) { 57 | self.name.clear(); 58 | } 59 | 60 | // Param is passed by value, moved 61 | pub fn set_name(&mut self, v: ::std::string::String) { 62 | self.name = v; 63 | } 64 | 65 | // Mutable pointer to the field. 66 | // If field is not initialized, it is initialized with default value first. 67 | pub fn mut_name(&mut self) -> &mut ::std::string::String { 68 | &mut self.name 69 | } 70 | 71 | // Take field 72 | pub fn take_name(&mut self) -> ::std::string::String { 73 | ::std::mem::replace(&mut self.name, ::std::string::String::new()) 74 | } 75 | 76 | // .foobar.Location location = 2; 77 | 78 | 79 | pub fn get_location(&self) -> &Location { 80 | self.location.as_ref().unwrap_or_else(|| Location::default_instance()) 81 | } 82 | pub fn clear_location(&mut self) { 83 | self.location.clear(); 84 | } 85 | 86 | pub fn has_location(&self) -> bool { 87 | self.location.is_some() 88 | } 89 | 90 | // Param is passed by value, moved 91 | pub fn set_location(&mut self, v: Location) { 92 | self.location = ::protobuf::SingularPtrField::some(v); 93 | } 94 | 95 | // Mutable pointer to the field. 96 | // If field is not initialized, it is initialized with default value first. 97 | pub fn mut_location(&mut self) -> &mut Location { 98 | if self.location.is_none() { 99 | self.location.set_default(); 100 | } 101 | self.location.as_mut().unwrap() 102 | } 103 | 104 | // Take field 105 | pub fn take_location(&mut self) -> Location { 106 | self.location.take().unwrap_or_else(|| Location::new()) 107 | } 108 | } 109 | 110 | impl ::protobuf::Message for CabLocationRequest { 111 | fn is_initialized(&self) -> bool { 112 | for v in &self.location { 113 | if !v.is_initialized() { 114 | return false; 115 | } 116 | }; 117 | true 118 | } 119 | 120 | fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { 121 | while !is.eof()? { 122 | let (field_number, wire_type) = is.read_tag_unpack()?; 123 | match field_number { 124 | 1 => { 125 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?; 126 | }, 127 | 2 => { 128 | ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.location)?; 129 | }, 130 | _ => { 131 | ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; 132 | }, 133 | }; 134 | } 135 | ::std::result::Result::Ok(()) 136 | } 137 | 138 | // Compute sizes of nested messages 139 | #[allow(unused_variables)] 140 | fn compute_size(&self) -> u32 { 141 | let mut my_size = 0; 142 | if !self.name.is_empty() { 143 | my_size += ::protobuf::rt::string_size(1, &self.name); 144 | } 145 | if let Some(ref v) = self.location.as_ref() { 146 | let len = v.compute_size(); 147 | my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; 148 | } 149 | my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); 150 | self.cached_size.set(my_size); 151 | my_size 152 | } 153 | 154 | fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { 155 | if !self.name.is_empty() { 156 | os.write_string(1, &self.name)?; 157 | } 158 | if let Some(ref v) = self.location.as_ref() { 159 | os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; 160 | os.write_raw_varint32(v.get_cached_size())?; 161 | v.write_to_with_cached_sizes(os)?; 162 | } 163 | os.write_unknown_fields(self.get_unknown_fields())?; 164 | ::std::result::Result::Ok(()) 165 | } 166 | 167 | fn get_cached_size(&self) -> u32 { 168 | self.cached_size.get() 169 | } 170 | 171 | fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { 172 | &self.unknown_fields 173 | } 174 | 175 | fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { 176 | &mut self.unknown_fields 177 | } 178 | 179 | fn as_any(&self) -> &dyn (::std::any::Any) { 180 | self as &dyn (::std::any::Any) 181 | } 182 | fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { 183 | self as &mut dyn (::std::any::Any) 184 | } 185 | fn into_any(self: Box) -> ::std::boxed::Box { 186 | self 187 | } 188 | 189 | fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { 190 | Self::descriptor_static() 191 | } 192 | 193 | fn new() -> CabLocationRequest { 194 | CabLocationRequest::new() 195 | } 196 | 197 | fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { 198 | static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT; 199 | unsafe { 200 | descriptor.get(|| { 201 | let mut fields = ::std::vec::Vec::new(); 202 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 203 | "name", 204 | |m: &CabLocationRequest| { &m.name }, 205 | |m: &mut CabLocationRequest| { &mut m.name }, 206 | )); 207 | fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( 208 | "location", 209 | |m: &CabLocationRequest| { &m.location }, 210 | |m: &mut CabLocationRequest| { &mut m.location }, 211 | )); 212 | ::protobuf::reflect::MessageDescriptor::new_pb_name::( 213 | "CabLocationRequest", 214 | fields, 215 | file_descriptor_proto() 216 | ) 217 | }) 218 | } 219 | } 220 | 221 | fn default_instance() -> &'static CabLocationRequest { 222 | static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy::INIT; 223 | unsafe { 224 | instance.get(CabLocationRequest::new) 225 | } 226 | } 227 | } 228 | 229 | impl ::protobuf::Clear for CabLocationRequest { 230 | fn clear(&mut self) { 231 | self.name.clear(); 232 | self.location.clear(); 233 | self.unknown_fields.clear(); 234 | } 235 | } 236 | 237 | impl ::std::fmt::Debug for CabLocationRequest { 238 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 239 | ::protobuf::text_format::fmt(self, f) 240 | } 241 | } 242 | 243 | impl ::protobuf::reflect::ProtobufValue for CabLocationRequest { 244 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 245 | ::protobuf::reflect::ReflectValueRef::Message(self) 246 | } 247 | } 248 | 249 | #[derive(PartialEq,Clone,Default)] 250 | pub struct CabLocationResponse { 251 | // message fields 252 | pub accepted: bool, 253 | // special fields 254 | pub unknown_fields: ::protobuf::UnknownFields, 255 | pub cached_size: ::protobuf::CachedSize, 256 | } 257 | 258 | impl<'a> ::std::default::Default for &'a CabLocationResponse { 259 | fn default() -> &'a CabLocationResponse { 260 | ::default_instance() 261 | } 262 | } 263 | 264 | impl CabLocationResponse { 265 | pub fn new() -> CabLocationResponse { 266 | ::std::default::Default::default() 267 | } 268 | 269 | // bool accepted = 1; 270 | 271 | 272 | pub fn get_accepted(&self) -> bool { 273 | self.accepted 274 | } 275 | pub fn clear_accepted(&mut self) { 276 | self.accepted = false; 277 | } 278 | 279 | // Param is passed by value, moved 280 | pub fn set_accepted(&mut self, v: bool) { 281 | self.accepted = v; 282 | } 283 | } 284 | 285 | impl ::protobuf::Message for CabLocationResponse { 286 | fn is_initialized(&self) -> bool { 287 | true 288 | } 289 | 290 | fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { 291 | while !is.eof()? { 292 | let (field_number, wire_type) = is.read_tag_unpack()?; 293 | match field_number { 294 | 1 => { 295 | if wire_type != ::protobuf::wire_format::WireTypeVarint { 296 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 297 | } 298 | let tmp = is.read_bool()?; 299 | self.accepted = tmp; 300 | }, 301 | _ => { 302 | ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; 303 | }, 304 | }; 305 | } 306 | ::std::result::Result::Ok(()) 307 | } 308 | 309 | // Compute sizes of nested messages 310 | #[allow(unused_variables)] 311 | fn compute_size(&self) -> u32 { 312 | let mut my_size = 0; 313 | if self.accepted != false { 314 | my_size += 2; 315 | } 316 | my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); 317 | self.cached_size.set(my_size); 318 | my_size 319 | } 320 | 321 | fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { 322 | if self.accepted != false { 323 | os.write_bool(1, self.accepted)?; 324 | } 325 | os.write_unknown_fields(self.get_unknown_fields())?; 326 | ::std::result::Result::Ok(()) 327 | } 328 | 329 | fn get_cached_size(&self) -> u32 { 330 | self.cached_size.get() 331 | } 332 | 333 | fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { 334 | &self.unknown_fields 335 | } 336 | 337 | fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { 338 | &mut self.unknown_fields 339 | } 340 | 341 | fn as_any(&self) -> &dyn (::std::any::Any) { 342 | self as &dyn (::std::any::Any) 343 | } 344 | fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { 345 | self as &mut dyn (::std::any::Any) 346 | } 347 | fn into_any(self: Box) -> ::std::boxed::Box { 348 | self 349 | } 350 | 351 | fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { 352 | Self::descriptor_static() 353 | } 354 | 355 | fn new() -> CabLocationResponse { 356 | CabLocationResponse::new() 357 | } 358 | 359 | fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { 360 | static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT; 361 | unsafe { 362 | descriptor.get(|| { 363 | let mut fields = ::std::vec::Vec::new(); 364 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( 365 | "accepted", 366 | |m: &CabLocationResponse| { &m.accepted }, 367 | |m: &mut CabLocationResponse| { &mut m.accepted }, 368 | )); 369 | ::protobuf::reflect::MessageDescriptor::new_pb_name::( 370 | "CabLocationResponse", 371 | fields, 372 | file_descriptor_proto() 373 | ) 374 | }) 375 | } 376 | } 377 | 378 | fn default_instance() -> &'static CabLocationResponse { 379 | static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy::INIT; 380 | unsafe { 381 | instance.get(CabLocationResponse::new) 382 | } 383 | } 384 | } 385 | 386 | impl ::protobuf::Clear for CabLocationResponse { 387 | fn clear(&mut self) { 388 | self.accepted = false; 389 | self.unknown_fields.clear(); 390 | } 391 | } 392 | 393 | impl ::std::fmt::Debug for CabLocationResponse { 394 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 395 | ::protobuf::text_format::fmt(self, f) 396 | } 397 | } 398 | 399 | impl ::protobuf::reflect::ProtobufValue for CabLocationResponse { 400 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 401 | ::protobuf::reflect::ReflectValueRef::Message(self) 402 | } 403 | } 404 | 405 | #[derive(PartialEq,Clone,Default)] 406 | pub struct GetCabRequest { 407 | // message fields 408 | pub location: ::protobuf::SingularPtrField, 409 | // special fields 410 | pub unknown_fields: ::protobuf::UnknownFields, 411 | pub cached_size: ::protobuf::CachedSize, 412 | } 413 | 414 | impl<'a> ::std::default::Default for &'a GetCabRequest { 415 | fn default() -> &'a GetCabRequest { 416 | ::default_instance() 417 | } 418 | } 419 | 420 | impl GetCabRequest { 421 | pub fn new() -> GetCabRequest { 422 | ::std::default::Default::default() 423 | } 424 | 425 | // .foobar.Location location = 1; 426 | 427 | 428 | pub fn get_location(&self) -> &Location { 429 | self.location.as_ref().unwrap_or_else(|| Location::default_instance()) 430 | } 431 | pub fn clear_location(&mut self) { 432 | self.location.clear(); 433 | } 434 | 435 | pub fn has_location(&self) -> bool { 436 | self.location.is_some() 437 | } 438 | 439 | // Param is passed by value, moved 440 | pub fn set_location(&mut self, v: Location) { 441 | self.location = ::protobuf::SingularPtrField::some(v); 442 | } 443 | 444 | // Mutable pointer to the field. 445 | // If field is not initialized, it is initialized with default value first. 446 | pub fn mut_location(&mut self) -> &mut Location { 447 | if self.location.is_none() { 448 | self.location.set_default(); 449 | } 450 | self.location.as_mut().unwrap() 451 | } 452 | 453 | // Take field 454 | pub fn take_location(&mut self) -> Location { 455 | self.location.take().unwrap_or_else(|| Location::new()) 456 | } 457 | } 458 | 459 | impl ::protobuf::Message for GetCabRequest { 460 | fn is_initialized(&self) -> bool { 461 | for v in &self.location { 462 | if !v.is_initialized() { 463 | return false; 464 | } 465 | }; 466 | true 467 | } 468 | 469 | fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { 470 | while !is.eof()? { 471 | let (field_number, wire_type) = is.read_tag_unpack()?; 472 | match field_number { 473 | 1 => { 474 | ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.location)?; 475 | }, 476 | _ => { 477 | ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; 478 | }, 479 | }; 480 | } 481 | ::std::result::Result::Ok(()) 482 | } 483 | 484 | // Compute sizes of nested messages 485 | #[allow(unused_variables)] 486 | fn compute_size(&self) -> u32 { 487 | let mut my_size = 0; 488 | if let Some(ref v) = self.location.as_ref() { 489 | let len = v.compute_size(); 490 | my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; 491 | } 492 | my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); 493 | self.cached_size.set(my_size); 494 | my_size 495 | } 496 | 497 | fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { 498 | if let Some(ref v) = self.location.as_ref() { 499 | os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; 500 | os.write_raw_varint32(v.get_cached_size())?; 501 | v.write_to_with_cached_sizes(os)?; 502 | } 503 | os.write_unknown_fields(self.get_unknown_fields())?; 504 | ::std::result::Result::Ok(()) 505 | } 506 | 507 | fn get_cached_size(&self) -> u32 { 508 | self.cached_size.get() 509 | } 510 | 511 | fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { 512 | &self.unknown_fields 513 | } 514 | 515 | fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { 516 | &mut self.unknown_fields 517 | } 518 | 519 | fn as_any(&self) -> &dyn (::std::any::Any) { 520 | self as &dyn (::std::any::Any) 521 | } 522 | fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { 523 | self as &mut dyn (::std::any::Any) 524 | } 525 | fn into_any(self: Box) -> ::std::boxed::Box { 526 | self 527 | } 528 | 529 | fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { 530 | Self::descriptor_static() 531 | } 532 | 533 | fn new() -> GetCabRequest { 534 | GetCabRequest::new() 535 | } 536 | 537 | fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { 538 | static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT; 539 | unsafe { 540 | descriptor.get(|| { 541 | let mut fields = ::std::vec::Vec::new(); 542 | fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( 543 | "location", 544 | |m: &GetCabRequest| { &m.location }, 545 | |m: &mut GetCabRequest| { &mut m.location }, 546 | )); 547 | ::protobuf::reflect::MessageDescriptor::new_pb_name::( 548 | "GetCabRequest", 549 | fields, 550 | file_descriptor_proto() 551 | ) 552 | }) 553 | } 554 | } 555 | 556 | fn default_instance() -> &'static GetCabRequest { 557 | static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy::INIT; 558 | unsafe { 559 | instance.get(GetCabRequest::new) 560 | } 561 | } 562 | } 563 | 564 | impl ::protobuf::Clear for GetCabRequest { 565 | fn clear(&mut self) { 566 | self.location.clear(); 567 | self.unknown_fields.clear(); 568 | } 569 | } 570 | 571 | impl ::std::fmt::Debug for GetCabRequest { 572 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 573 | ::protobuf::text_format::fmt(self, f) 574 | } 575 | } 576 | 577 | impl ::protobuf::reflect::ProtobufValue for GetCabRequest { 578 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 579 | ::protobuf::reflect::ReflectValueRef::Message(self) 580 | } 581 | } 582 | 583 | #[derive(PartialEq,Clone,Default)] 584 | pub struct GetCabResponse { 585 | // message fields 586 | pub cabs: ::protobuf::RepeatedField, 587 | // special fields 588 | pub unknown_fields: ::protobuf::UnknownFields, 589 | pub cached_size: ::protobuf::CachedSize, 590 | } 591 | 592 | impl<'a> ::std::default::Default for &'a GetCabResponse { 593 | fn default() -> &'a GetCabResponse { 594 | ::default_instance() 595 | } 596 | } 597 | 598 | impl GetCabResponse { 599 | pub fn new() -> GetCabResponse { 600 | ::std::default::Default::default() 601 | } 602 | 603 | // repeated .foobar.Cab cabs = 1; 604 | 605 | 606 | pub fn get_cabs(&self) -> &[Cab] { 607 | &self.cabs 608 | } 609 | pub fn clear_cabs(&mut self) { 610 | self.cabs.clear(); 611 | } 612 | 613 | // Param is passed by value, moved 614 | pub fn set_cabs(&mut self, v: ::protobuf::RepeatedField) { 615 | self.cabs = v; 616 | } 617 | 618 | // Mutable pointer to the field. 619 | pub fn mut_cabs(&mut self) -> &mut ::protobuf::RepeatedField { 620 | &mut self.cabs 621 | } 622 | 623 | // Take field 624 | pub fn take_cabs(&mut self) -> ::protobuf::RepeatedField { 625 | ::std::mem::replace(&mut self.cabs, ::protobuf::RepeatedField::new()) 626 | } 627 | } 628 | 629 | impl ::protobuf::Message for GetCabResponse { 630 | fn is_initialized(&self) -> bool { 631 | for v in &self.cabs { 632 | if !v.is_initialized() { 633 | return false; 634 | } 635 | }; 636 | true 637 | } 638 | 639 | fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { 640 | while !is.eof()? { 641 | let (field_number, wire_type) = is.read_tag_unpack()?; 642 | match field_number { 643 | 1 => { 644 | ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.cabs)?; 645 | }, 646 | _ => { 647 | ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; 648 | }, 649 | }; 650 | } 651 | ::std::result::Result::Ok(()) 652 | } 653 | 654 | // Compute sizes of nested messages 655 | #[allow(unused_variables)] 656 | fn compute_size(&self) -> u32 { 657 | let mut my_size = 0; 658 | for value in &self.cabs { 659 | let len = value.compute_size(); 660 | my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; 661 | }; 662 | my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); 663 | self.cached_size.set(my_size); 664 | my_size 665 | } 666 | 667 | fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { 668 | for v in &self.cabs { 669 | os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; 670 | os.write_raw_varint32(v.get_cached_size())?; 671 | v.write_to_with_cached_sizes(os)?; 672 | }; 673 | os.write_unknown_fields(self.get_unknown_fields())?; 674 | ::std::result::Result::Ok(()) 675 | } 676 | 677 | fn get_cached_size(&self) -> u32 { 678 | self.cached_size.get() 679 | } 680 | 681 | fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { 682 | &self.unknown_fields 683 | } 684 | 685 | fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { 686 | &mut self.unknown_fields 687 | } 688 | 689 | fn as_any(&self) -> &dyn (::std::any::Any) { 690 | self as &dyn (::std::any::Any) 691 | } 692 | fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { 693 | self as &mut dyn (::std::any::Any) 694 | } 695 | fn into_any(self: Box) -> ::std::boxed::Box { 696 | self 697 | } 698 | 699 | fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { 700 | Self::descriptor_static() 701 | } 702 | 703 | fn new() -> GetCabResponse { 704 | GetCabResponse::new() 705 | } 706 | 707 | fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { 708 | static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT; 709 | unsafe { 710 | descriptor.get(|| { 711 | let mut fields = ::std::vec::Vec::new(); 712 | fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( 713 | "cabs", 714 | |m: &GetCabResponse| { &m.cabs }, 715 | |m: &mut GetCabResponse| { &mut m.cabs }, 716 | )); 717 | ::protobuf::reflect::MessageDescriptor::new_pb_name::( 718 | "GetCabResponse", 719 | fields, 720 | file_descriptor_proto() 721 | ) 722 | }) 723 | } 724 | } 725 | 726 | fn default_instance() -> &'static GetCabResponse { 727 | static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy::INIT; 728 | unsafe { 729 | instance.get(GetCabResponse::new) 730 | } 731 | } 732 | } 733 | 734 | impl ::protobuf::Clear for GetCabResponse { 735 | fn clear(&mut self) { 736 | self.cabs.clear(); 737 | self.unknown_fields.clear(); 738 | } 739 | } 740 | 741 | impl ::std::fmt::Debug for GetCabResponse { 742 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 743 | ::protobuf::text_format::fmt(self, f) 744 | } 745 | } 746 | 747 | impl ::protobuf::reflect::ProtobufValue for GetCabResponse { 748 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 749 | ::protobuf::reflect::ReflectValueRef::Message(self) 750 | } 751 | } 752 | 753 | #[derive(PartialEq,Clone,Default)] 754 | pub struct Cab { 755 | // message fields 756 | pub name: ::std::string::String, 757 | pub location: ::protobuf::SingularPtrField, 758 | // special fields 759 | pub unknown_fields: ::protobuf::UnknownFields, 760 | pub cached_size: ::protobuf::CachedSize, 761 | } 762 | 763 | impl<'a> ::std::default::Default for &'a Cab { 764 | fn default() -> &'a Cab { 765 | ::default_instance() 766 | } 767 | } 768 | 769 | impl Cab { 770 | pub fn new() -> Cab { 771 | ::std::default::Default::default() 772 | } 773 | 774 | // string name = 1; 775 | 776 | 777 | pub fn get_name(&self) -> &str { 778 | &self.name 779 | } 780 | pub fn clear_name(&mut self) { 781 | self.name.clear(); 782 | } 783 | 784 | // Param is passed by value, moved 785 | pub fn set_name(&mut self, v: ::std::string::String) { 786 | self.name = v; 787 | } 788 | 789 | // Mutable pointer to the field. 790 | // If field is not initialized, it is initialized with default value first. 791 | pub fn mut_name(&mut self) -> &mut ::std::string::String { 792 | &mut self.name 793 | } 794 | 795 | // Take field 796 | pub fn take_name(&mut self) -> ::std::string::String { 797 | ::std::mem::replace(&mut self.name, ::std::string::String::new()) 798 | } 799 | 800 | // .foobar.Location location = 2; 801 | 802 | 803 | pub fn get_location(&self) -> &Location { 804 | self.location.as_ref().unwrap_or_else(|| Location::default_instance()) 805 | } 806 | pub fn clear_location(&mut self) { 807 | self.location.clear(); 808 | } 809 | 810 | pub fn has_location(&self) -> bool { 811 | self.location.is_some() 812 | } 813 | 814 | // Param is passed by value, moved 815 | pub fn set_location(&mut self, v: Location) { 816 | self.location = ::protobuf::SingularPtrField::some(v); 817 | } 818 | 819 | // Mutable pointer to the field. 820 | // If field is not initialized, it is initialized with default value first. 821 | pub fn mut_location(&mut self) -> &mut Location { 822 | if self.location.is_none() { 823 | self.location.set_default(); 824 | } 825 | self.location.as_mut().unwrap() 826 | } 827 | 828 | // Take field 829 | pub fn take_location(&mut self) -> Location { 830 | self.location.take().unwrap_or_else(|| Location::new()) 831 | } 832 | } 833 | 834 | impl ::protobuf::Message for Cab { 835 | fn is_initialized(&self) -> bool { 836 | for v in &self.location { 837 | if !v.is_initialized() { 838 | return false; 839 | } 840 | }; 841 | true 842 | } 843 | 844 | fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { 845 | while !is.eof()? { 846 | let (field_number, wire_type) = is.read_tag_unpack()?; 847 | match field_number { 848 | 1 => { 849 | ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.name)?; 850 | }, 851 | 2 => { 852 | ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.location)?; 853 | }, 854 | _ => { 855 | ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; 856 | }, 857 | }; 858 | } 859 | ::std::result::Result::Ok(()) 860 | } 861 | 862 | // Compute sizes of nested messages 863 | #[allow(unused_variables)] 864 | fn compute_size(&self) -> u32 { 865 | let mut my_size = 0; 866 | if !self.name.is_empty() { 867 | my_size += ::protobuf::rt::string_size(1, &self.name); 868 | } 869 | if let Some(ref v) = self.location.as_ref() { 870 | let len = v.compute_size(); 871 | my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; 872 | } 873 | my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); 874 | self.cached_size.set(my_size); 875 | my_size 876 | } 877 | 878 | fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { 879 | if !self.name.is_empty() { 880 | os.write_string(1, &self.name)?; 881 | } 882 | if let Some(ref v) = self.location.as_ref() { 883 | os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; 884 | os.write_raw_varint32(v.get_cached_size())?; 885 | v.write_to_with_cached_sizes(os)?; 886 | } 887 | os.write_unknown_fields(self.get_unknown_fields())?; 888 | ::std::result::Result::Ok(()) 889 | } 890 | 891 | fn get_cached_size(&self) -> u32 { 892 | self.cached_size.get() 893 | } 894 | 895 | fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { 896 | &self.unknown_fields 897 | } 898 | 899 | fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { 900 | &mut self.unknown_fields 901 | } 902 | 903 | fn as_any(&self) -> &dyn (::std::any::Any) { 904 | self as &dyn (::std::any::Any) 905 | } 906 | fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { 907 | self as &mut dyn (::std::any::Any) 908 | } 909 | fn into_any(self: Box) -> ::std::boxed::Box { 910 | self 911 | } 912 | 913 | fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { 914 | Self::descriptor_static() 915 | } 916 | 917 | fn new() -> Cab { 918 | Cab::new() 919 | } 920 | 921 | fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { 922 | static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT; 923 | unsafe { 924 | descriptor.get(|| { 925 | let mut fields = ::std::vec::Vec::new(); 926 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( 927 | "name", 928 | |m: &Cab| { &m.name }, 929 | |m: &mut Cab| { &mut m.name }, 930 | )); 931 | fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( 932 | "location", 933 | |m: &Cab| { &m.location }, 934 | |m: &mut Cab| { &mut m.location }, 935 | )); 936 | ::protobuf::reflect::MessageDescriptor::new_pb_name::( 937 | "Cab", 938 | fields, 939 | file_descriptor_proto() 940 | ) 941 | }) 942 | } 943 | } 944 | 945 | fn default_instance() -> &'static Cab { 946 | static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy::INIT; 947 | unsafe { 948 | instance.get(Cab::new) 949 | } 950 | } 951 | } 952 | 953 | impl ::protobuf::Clear for Cab { 954 | fn clear(&mut self) { 955 | self.name.clear(); 956 | self.location.clear(); 957 | self.unknown_fields.clear(); 958 | } 959 | } 960 | 961 | impl ::std::fmt::Debug for Cab { 962 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 963 | ::protobuf::text_format::fmt(self, f) 964 | } 965 | } 966 | 967 | impl ::protobuf::reflect::ProtobufValue for Cab { 968 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 969 | ::protobuf::reflect::ReflectValueRef::Message(self) 970 | } 971 | } 972 | 973 | #[derive(PartialEq,Clone,Default)] 974 | pub struct Location { 975 | // message fields 976 | pub latitude: f32, 977 | pub longitude: f32, 978 | // special fields 979 | pub unknown_fields: ::protobuf::UnknownFields, 980 | pub cached_size: ::protobuf::CachedSize, 981 | } 982 | 983 | impl<'a> ::std::default::Default for &'a Location { 984 | fn default() -> &'a Location { 985 | ::default_instance() 986 | } 987 | } 988 | 989 | impl Location { 990 | pub fn new() -> Location { 991 | ::std::default::Default::default() 992 | } 993 | 994 | // float latitude = 1; 995 | 996 | 997 | pub fn get_latitude(&self) -> f32 { 998 | self.latitude 999 | } 1000 | pub fn clear_latitude(&mut self) { 1001 | self.latitude = 0.; 1002 | } 1003 | 1004 | // Param is passed by value, moved 1005 | pub fn set_latitude(&mut self, v: f32) { 1006 | self.latitude = v; 1007 | } 1008 | 1009 | // float longitude = 2; 1010 | 1011 | 1012 | pub fn get_longitude(&self) -> f32 { 1013 | self.longitude 1014 | } 1015 | pub fn clear_longitude(&mut self) { 1016 | self.longitude = 0.; 1017 | } 1018 | 1019 | // Param is passed by value, moved 1020 | pub fn set_longitude(&mut self, v: f32) { 1021 | self.longitude = v; 1022 | } 1023 | } 1024 | 1025 | impl ::protobuf::Message for Location { 1026 | fn is_initialized(&self) -> bool { 1027 | true 1028 | } 1029 | 1030 | fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { 1031 | while !is.eof()? { 1032 | let (field_number, wire_type) = is.read_tag_unpack()?; 1033 | match field_number { 1034 | 1 => { 1035 | if wire_type != ::protobuf::wire_format::WireTypeFixed32 { 1036 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 1037 | } 1038 | let tmp = is.read_float()?; 1039 | self.latitude = tmp; 1040 | }, 1041 | 2 => { 1042 | if wire_type != ::protobuf::wire_format::WireTypeFixed32 { 1043 | return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); 1044 | } 1045 | let tmp = is.read_float()?; 1046 | self.longitude = tmp; 1047 | }, 1048 | _ => { 1049 | ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; 1050 | }, 1051 | }; 1052 | } 1053 | ::std::result::Result::Ok(()) 1054 | } 1055 | 1056 | // Compute sizes of nested messages 1057 | #[allow(unused_variables)] 1058 | fn compute_size(&self) -> u32 { 1059 | let mut my_size = 0; 1060 | if self.latitude != 0. { 1061 | my_size += 5; 1062 | } 1063 | if self.longitude != 0. { 1064 | my_size += 5; 1065 | } 1066 | my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); 1067 | self.cached_size.set(my_size); 1068 | my_size 1069 | } 1070 | 1071 | fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { 1072 | if self.latitude != 0. { 1073 | os.write_float(1, self.latitude)?; 1074 | } 1075 | if self.longitude != 0. { 1076 | os.write_float(2, self.longitude)?; 1077 | } 1078 | os.write_unknown_fields(self.get_unknown_fields())?; 1079 | ::std::result::Result::Ok(()) 1080 | } 1081 | 1082 | fn get_cached_size(&self) -> u32 { 1083 | self.cached_size.get() 1084 | } 1085 | 1086 | fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { 1087 | &self.unknown_fields 1088 | } 1089 | 1090 | fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { 1091 | &mut self.unknown_fields 1092 | } 1093 | 1094 | fn as_any(&self) -> &dyn (::std::any::Any) { 1095 | self as &dyn (::std::any::Any) 1096 | } 1097 | fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { 1098 | self as &mut dyn (::std::any::Any) 1099 | } 1100 | fn into_any(self: Box) -> ::std::boxed::Box { 1101 | self 1102 | } 1103 | 1104 | fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { 1105 | Self::descriptor_static() 1106 | } 1107 | 1108 | fn new() -> Location { 1109 | Location::new() 1110 | } 1111 | 1112 | fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { 1113 | static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy::INIT; 1114 | unsafe { 1115 | descriptor.get(|| { 1116 | let mut fields = ::std::vec::Vec::new(); 1117 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeFloat>( 1118 | "latitude", 1119 | |m: &Location| { &m.latitude }, 1120 | |m: &mut Location| { &mut m.latitude }, 1121 | )); 1122 | fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeFloat>( 1123 | "longitude", 1124 | |m: &Location| { &m.longitude }, 1125 | |m: &mut Location| { &mut m.longitude }, 1126 | )); 1127 | ::protobuf::reflect::MessageDescriptor::new_pb_name::( 1128 | "Location", 1129 | fields, 1130 | file_descriptor_proto() 1131 | ) 1132 | }) 1133 | } 1134 | } 1135 | 1136 | fn default_instance() -> &'static Location { 1137 | static mut instance: ::protobuf::lazy::Lazy = ::protobuf::lazy::Lazy::INIT; 1138 | unsafe { 1139 | instance.get(Location::new) 1140 | } 1141 | } 1142 | } 1143 | 1144 | impl ::protobuf::Clear for Location { 1145 | fn clear(&mut self) { 1146 | self.latitude = 0.; 1147 | self.longitude = 0.; 1148 | self.unknown_fields.clear(); 1149 | } 1150 | } 1151 | 1152 | impl ::std::fmt::Debug for Location { 1153 | fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 1154 | ::protobuf::text_format::fmt(self, f) 1155 | } 1156 | } 1157 | 1158 | impl ::protobuf::reflect::ProtobufValue for Location { 1159 | fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { 1160 | ::protobuf::reflect::ReflectValueRef::Message(self) 1161 | } 1162 | } 1163 | 1164 | static file_descriptor_proto_data: &'static [u8] = b"\ 1165 | \n\x0cfoobar.proto\x12\x06foobar\"V\n\x12CabLocationRequest\x12\x12\n\ 1166 | \x04name\x18\x01\x20\x01(\tR\x04name\x12,\n\x08location\x18\x02\x20\x01(\ 1167 | \x0b2\x10.foobar.LocationR\x08location\"1\n\x13CabLocationResponse\x12\ 1168 | \x1a\n\x08accepted\x18\x01\x20\x01(\x08R\x08accepted\"=\n\rGetCabRequest\ 1169 | \x12,\n\x08location\x18\x01\x20\x01(\x0b2\x10.foobar.LocationR\x08locati\ 1170 | on\"1\n\x0eGetCabResponse\x12\x1f\n\x04cabs\x18\x01\x20\x03(\x0b2\x0b.fo\ 1171 | obar.CabR\x04cabs\"G\n\x03Cab\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04n\ 1172 | ame\x12,\n\x08location\x18\x02\x20\x01(\x0b2\x10.foobar.LocationR\x08loc\ 1173 | ation\"D\n\x08Location\x12\x1a\n\x08latitude\x18\x01\x20\x01(\x02R\x08la\ 1174 | titude\x12\x1c\n\tlongitude\x18\x02\x20\x01(\x02R\tlongitude2\x9a\x01\n\ 1175 | \rFooBarService\x12N\n\x13record_cab_location\x12\x1a.foobar.CabLocation\ 1176 | Request\x1a\x1b.foobar.CabLocationResponse\x129\n\x08get_cabs\x12\x15.fo\ 1177 | obar.GetCabRequest\x1a\x16.foobar.GetCabResponseb\x06proto3\ 1178 | "; 1179 | 1180 | static mut file_descriptor_proto_lazy: ::protobuf::lazy::Lazy<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::lazy::Lazy::INIT; 1181 | 1182 | fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { 1183 | ::protobuf::parse_from_bytes(file_descriptor_proto_data).unwrap() 1184 | } 1185 | 1186 | pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { 1187 | unsafe { 1188 | file_descriptor_proto_lazy.get(|| { 1189 | parse_descriptor_proto() 1190 | }) 1191 | } 1192 | } 1193 | --------------------------------------------------------------------------------