Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/daheige/rust-bible
/ functions
Functions
416 in github.com/daheige/rust-bible
⨍
Functions
416
◇
Types & classes
143
Function
main
通过消息传递channel进行通信,避免了需要用户显式锁定的要求 在rust标准库中提供了std::sync::mpsc 多个生产者/单个消费者模型的消息通信的队列 mpsc提供了2种方式的消息通信:channel 异步有缓冲通道 和 sync_channel 同步的有界缓冲通道
part1/concurrent/channel_demo/src/main.rs:7
Function
main
()
part1/cell_demo/src/main.rs:73
Function
main
()
part1/async_await/src/main.rs:6
Function
main
()
part1/process_ctrl/src/main.rs:1
Function
main
()
part1/advanced_concept/src/main.rs:74
Function
main
()
part1/borrwer/src/main.rs:16
Function
main
()
part1/error_handler/src/main.rs:5
Function
main
()
part1/iterators/src/main.rs:1
Function
main
()
part1/generics_trait_lifetime/src/main.rs:254
Function
main
()
part1/generics_demo/src/main.rs:31
Function
main
()
part1/closures/src/main.rs:4
Function
main
()
part1/hello_world/src/main.rs:1
Function
main
()
part1/my-mod2/src/main.rs:17
Function
map_test
()
part1/macro/macro_map/src/lib.rs:26
Function
max
在函数中定义泛型 下面是一个i32 slice取得最大值
part1/generics_trait_lifetime/src/main.rs:160
Function
max2
T 指定trait PartialOrd trait 特征可以比较大小
part1/generics_trait_lifetime/src/main.rs:175
Function
max3
(s: &[T])
part1/generics_trait_lifetime/src/main.rs:207
Method
merge_from
(&mut self, is: &mut ::protobuf::CodedInputStream<'_>)
part7/grpc/grpc-hello/src/rust_grpc/hello.rs:94
Function
message_mp
()
part1/concurrent/fearless_concurrent/src/main.rs:112
Function
message_mp
()
part1/concurrent/channel_demo/src/main.rs:43
Function
message_pass
()
part1/concurrent/fearless_concurrent/src/main.rs:78
Function
message_pass2
()
part1/concurrent/fearless_concurrent/src/main.rs:96
Method
model
(&self)
part1/super_player/src/main.rs:24
Function
multiply
函数定义
part8/cc-cpp-demo/src/foo.cpp:8
Method
mut_message
Mutable pointer to the field. If field is not initialized, it is initialized with default value first.
part7/grpc/grpc-hello/src/rust_grpc/hello.rs:284
Method
mut_name
Mutable pointer to the field. If field is not initialized, it is initialized with default value first.
part7/grpc/grpc-hello/src/rust_grpc/hello.rs:79
Function
mutex_share_data
()
part1/concurrent/fearless_concurrent/src/main.rs:220
Function
mutex_test
()
part1/concurrent/fearless_concurrent/src/main.rs:135
Method
new
(dsn: &str)
part3/redis-async/src/main.rs:27
Method
new
(dsn: &str)
part3/redis-demo/src/main.rs:76
Method
new
(duration: Duration)
part4/time-future/src/time_future.rs:37
Method
new
()
part7/grpc/grpc-hello/src/rust_grpc/hello.rs:43
Method
new
(inner: T)
part7/grpc/grpc-demo/src/rust_grpc/app.grpc.hello.rs:47
Method
new
(inner: T)
part7/grpc/grpc-demo/src/rust_grpc/hello.rs:46
Method
new
()
part1/link_demo/src/main.rs:19
Method
new
静态方法 Self表示当前类型Rectangle
part1/struct_demo/src/main.rs:13
Method
new
(n: &'a i64)
part1/memory/lifetime/src/main.rs:49
Method
new
(title: String, author: String, content: String)
part1/trait_demo/src/main.rs:41
Method
new
为Tesl实现关联方法,函数返回一个Tesl实例对象
part1/super_player/src/main.rs:16
Method
new
(val: T)
part1/trait_bound/src/intro.rs:65
Method
new
(toast: &str)
part1/my-mod/src/main.rs:10
Method
new
关联函数,它没有 self,相当于静态方法,可以直接调用
part1/compound_type/src/main.rs:36
Method
new
(x: i64, y: i64)
part1/cell_demo/src/main.rs:33
Method
new
初始化counter实例
part1/iterators/src/main.rs:56
Method
new
关联方法(静态方法)不需要self作为参数
part1/generics_trait_lifetime/src/main.rs:16
Method
new
(item: T)
part1/generics_demo/src/main.rs:15
Method
new
创建一个实例对象
part1/closures/src/main.rs:162
Method
new_pool
(dsn: &str)
part3/redis-pool/src/main.rs:29
Method
new_service_def
(handler: H)
part7/grpc/grpc-hello/src/rust_grpc/hello_grpc.rs:60
Function
no_dangle
()
part1/ref_var/src/main.rs:50
Function
order_shoes
接收body json数据
part5/tide-demo/src/main.rs:73
Method
pause
关联方法,相当于其他语言的静态方法,可以不需要实例,直接执行
part1/super_player/src/media.rs:9
Function
plus_one
(x: Option<i32>)
part1/match_demo/src/main.rs:31
Method
poll
(self: Pin<&mut Self>, cx: &mut Context<'_>)
part4/time-future/src/time_future.rs:22
Method
poll_close
(self: Pin<&mut Self>, _: &mut Context<'_>)
part4/tcp-http-demo/src/main.rs:121
Method
poll_flush
由于TcpStream无需flush和close,所以下面的方法直接返回了Poll::Ready
part4/tcp-http-demo/src/main.rs:117
Method
poll_read
( self: Pin<&mut Self>, _: &mut Context<'_>, buf: &mut [u8], )
part4/tcp-http-demo/src/main.rs:92
Method
poll_ready
( &mut self, _cx: &mut Context<'_>, )
part7/grpc/grpc-demo/src/rust_grpc/app.grpc.hello.rs:157
Method
poll_ready
( &mut self, _cx: &mut Context<'_>, )
part7/grpc/grpc-demo/src/rust_grpc/hello.rs:156
Method
poll_write
拷贝输入数据到mock的TcpStream中,完成后返回Poll::Ready
part4/tcp-http-demo/src/main.rs:107
Function
post_form
(Form(input): Form<Input>)
part5/axum-demo/src/main.rs:154
Function
post_sum
这里form是指定的web::Form类型
part5/actix-web-demo/src/main.rs:37
Method
print2
(&self)
part1/compound_type/src/main.rs:281
Function
read
返回一个!,这个表明该函数是一个发散函数,不会返回任何值,包括()
part1/compound_type/src/main.rs:240
Function
read
()
part1/error_handler/src/main.rs:74
Function
read2
()
part1/error_handler/src/main.rs:90
Function
read_file
()
part1/result_demo/src/main.rs:20
Function
read_file2
通过?简写来进行错误传播 当遇到错误的时候,?会直接返回错误,程序不会往下走 当执行成功,没错误,把值放到Ok(v)里面
part1/error_handler/src/main.rs:51
Function
read_yaml2
()
part2/read_yaml/src/main.rs:72
Function
redirect
(_req: Request<()>)
part5/tide-demo/src/main.rs:161
Method
redis_connection
(dsn: &str)
part3/redis-demo/src/main.rs:107
Function
redis_demo
()
part3/redis-demo/src/main.rs:125
Function
remove_cookie
(req: Request<()>)
part5/tide-demo/src/main.rs:178
Function
req_block_v1
()
part1/reqwest-demo/src/main.rs:52
Function
request_block
()
part1/reqwest-demo/src/main.rs:43
Function
request_json_parse
()
part1/reqwest-demo/src/main.rs:61
Function
say
(name: &str)
part1/my-mod2/src/front_of_house.rs:2
Method
say_hello
( &self, _: ServerHandlerContext, req: ServerRequestSingle<HelloReq>, resp: Se
part7/grpc/grpc-hello/src/main.rs:12
Method
say_hello
实现async_hello方法
part7/grpc/grpc-demo/src/main.rs:16
Method
send_gzip
(mut self)
part7/grpc/grpc-demo/src/rust_grpc/app.grpc.hello.rs:75
Method
send_gzip
(mut self)
part7/grpc/grpc-demo/src/rust_grpc/hello.rs:74
Method
serialize_message
(input: Self)
part3/pulsar-publish/src/main.rs:21
Method
serialize_message
(input: Self)
part3/pulsar-batch/src/main.rs:27
Function
set_cookie
Tide will use the the `Cookies`'s `Extract` implementation to build this parameter.
part5/tide-demo/src/main.rs:166
Method
set_id
Param is passed by value, moved
part7/grpc/grpc-hello/src/rust_grpc/hello.rs:58
Function
show_form
form
part5/axum-demo/src/main.rs:121
Function
static_lifetime
静态生命周期 'static 生命周期存活在整个程序期间,直接存储在程序的二进制文件中 所有的字符串字面量都拥有 'static 生命周期 将一个引用声明为 'static 之前需要考虑清楚,是否要这么做
part1/generics_trait_lifetime/src/main.rs:395
Function
string_demo
()
part1/collect/src/main.rs:151
Function
struct_lifetimes
()
part1/generics_trait_lifetime/src/main.rs:435
Function
submit
% curl --location --request POST 'localhost:8000/submit' \ --header 'Content-Type: application/json' \ --data-raw '{"name":"heige","legs":10}' */
part5/tide-demo/src/main.rs:88
Method
summarize
(&self)
part1/trait_demo/src/main.rs:58
Method
summarize_author
(&self)
part1/trait_demo/src/main.rs:65
Method
summary
(&self)
part1/generics_trait_lifetime/src/main.rs:91
Method
take_message
Take field
part7/grpc/grpc-hello/src/rust_grpc/hello.rs:289
Method
take_name
Take field
part7/grpc/grpc-hello/src/rust_grpc/hello.rs:84
Function
test_add
()
part1/unit_test/src/main.rs:26
Function
test_add
()
part1/hello_world/src/main.rs:25
Function
test_foo
()
part1/error_handler/src/main.rs:103
Function
test_handle_connection
()
part4/tcp-http-demo/src/main.rs:133
Function
test_json_macro
()
part2/serde_demo/src/main.rs:93
← previous
next →
301–400 of 416, ranked by callers