MCPcopy Create free account

hub / github.com/daheige/rust-bible / functions

Functions416 in github.com/daheige/rust-bible

Functionmain
通过消息传递channel进行通信,避免了需要用户显式锁定的要求 在rust标准库中提供了std::sync::mpsc 多个生产者/单个消费者模型的消息通信的队列 mpsc提供了2种方式的消息通信:channel 异步有缓冲通道 和 sync_channel 同步的有界缓冲通道
part1/concurrent/channel_demo/src/main.rs:7
Functionmain
()
part1/cell_demo/src/main.rs:73
Functionmain
()
part1/async_await/src/main.rs:6
Functionmain
()
part1/process_ctrl/src/main.rs:1
Functionmain
()
part1/advanced_concept/src/main.rs:74
Functionmain
()
part1/borrwer/src/main.rs:16
Functionmain
()
part1/error_handler/src/main.rs:5
Functionmain
()
part1/iterators/src/main.rs:1
Functionmain
()
part1/generics_trait_lifetime/src/main.rs:254
Functionmain
()
part1/generics_demo/src/main.rs:31
Functionmain
()
part1/closures/src/main.rs:4
Functionmain
()
part1/hello_world/src/main.rs:1
Functionmain
()
part1/my-mod2/src/main.rs:17
Functionmap_test
()
part1/macro/macro_map/src/lib.rs:26
Functionmax
在函数中定义泛型 下面是一个i32 slice取得最大值
part1/generics_trait_lifetime/src/main.rs:160
Functionmax2
T 指定trait PartialOrd trait 特征可以比较大小
part1/generics_trait_lifetime/src/main.rs:175
Functionmax3
(s: &[T])
part1/generics_trait_lifetime/src/main.rs:207
Methodmerge_from
(&mut self, is: &mut ::protobuf::CodedInputStream<'_>)
part7/grpc/grpc-hello/src/rust_grpc/hello.rs:94
Functionmessage_mp
()
part1/concurrent/fearless_concurrent/src/main.rs:112
Functionmessage_mp
()
part1/concurrent/channel_demo/src/main.rs:43
Functionmessage_pass
()
part1/concurrent/fearless_concurrent/src/main.rs:78
Functionmessage_pass2
()
part1/concurrent/fearless_concurrent/src/main.rs:96
Methodmodel
(&self)
part1/super_player/src/main.rs:24
Functionmultiply
函数定义
part8/cc-cpp-demo/src/foo.cpp:8
Methodmut_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
Methodmut_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
Functionmutex_share_data
()
part1/concurrent/fearless_concurrent/src/main.rs:220
Functionmutex_test
()
part1/concurrent/fearless_concurrent/src/main.rs:135
Methodnew
(dsn: &str)
part3/redis-async/src/main.rs:27
Methodnew
(dsn: &str)
part3/redis-demo/src/main.rs:76
Methodnew
(duration: Duration)
part4/time-future/src/time_future.rs:37
Methodnew
()
part7/grpc/grpc-hello/src/rust_grpc/hello.rs:43
Methodnew
(inner: T)
part7/grpc/grpc-demo/src/rust_grpc/app.grpc.hello.rs:47
Methodnew
(inner: T)
part7/grpc/grpc-demo/src/rust_grpc/hello.rs:46
Methodnew
()
part1/link_demo/src/main.rs:19
Methodnew
静态方法 Self表示当前类型Rectangle
part1/struct_demo/src/main.rs:13
Methodnew
(n: &'a i64)
part1/memory/lifetime/src/main.rs:49
Methodnew
(title: String, author: String, content: String)
part1/trait_demo/src/main.rs:41
Methodnew
为Tesl实现关联方法,函数返回一个Tesl实例对象
part1/super_player/src/main.rs:16
Methodnew
(val: T)
part1/trait_bound/src/intro.rs:65
Methodnew
(toast: &str)
part1/my-mod/src/main.rs:10
Methodnew
关联函数,它没有 self,相当于静态方法,可以直接调用
part1/compound_type/src/main.rs:36
Methodnew
(x: i64, y: i64)
part1/cell_demo/src/main.rs:33
Methodnew
初始化counter实例
part1/iterators/src/main.rs:56
Methodnew
关联方法(静态方法)不需要self作为参数
part1/generics_trait_lifetime/src/main.rs:16
Methodnew
(item: T)
part1/generics_demo/src/main.rs:15
Methodnew
创建一个实例对象
part1/closures/src/main.rs:162
Methodnew_pool
(dsn: &str)
part3/redis-pool/src/main.rs:29
Methodnew_service_def
(handler: H)
part7/grpc/grpc-hello/src/rust_grpc/hello_grpc.rs:60
Functionno_dangle
()
part1/ref_var/src/main.rs:50
Functionorder_shoes
接收body json数据
part5/tide-demo/src/main.rs:73
Methodpause
关联方法,相当于其他语言的静态方法,可以不需要实例,直接执行
part1/super_player/src/media.rs:9
Functionplus_one
(x: Option<i32>)
part1/match_demo/src/main.rs:31
Methodpoll
(self: Pin<&mut Self>, cx: &mut Context<'_>)
part4/time-future/src/time_future.rs:22
Methodpoll_close
(self: Pin<&mut Self>, _: &mut Context<'_>)
part4/tcp-http-demo/src/main.rs:121
Methodpoll_flush
由于TcpStream无需flush和close,所以下面的方法直接返回了Poll::Ready
part4/tcp-http-demo/src/main.rs:117
Methodpoll_read
( self: Pin<&mut Self>, _: &mut Context<'_>, buf: &mut [u8], )
part4/tcp-http-demo/src/main.rs:92
Methodpoll_ready
( &mut self, _cx: &mut Context<'_>, )
part7/grpc/grpc-demo/src/rust_grpc/app.grpc.hello.rs:157
Methodpoll_ready
( &mut self, _cx: &mut Context<'_>, )
part7/grpc/grpc-demo/src/rust_grpc/hello.rs:156
Methodpoll_write
拷贝输入数据到mock的TcpStream中,完成后返回Poll::Ready
part4/tcp-http-demo/src/main.rs:107
Functionpost_form
(Form(input): Form<Input>)
part5/axum-demo/src/main.rs:154
Functionpost_sum
这里form是指定的web::Form类型
part5/actix-web-demo/src/main.rs:37
Methodprint2
(&self)
part1/compound_type/src/main.rs:281
Functionread
返回一个!,这个表明该函数是一个发散函数,不会返回任何值,包括()
part1/compound_type/src/main.rs:240
Functionread
()
part1/error_handler/src/main.rs:74
Functionread2
()
part1/error_handler/src/main.rs:90
Functionread_file
()
part1/result_demo/src/main.rs:20
Functionread_file2
通过?简写来进行错误传播 当遇到错误的时候,?会直接返回错误,程序不会往下走 当执行成功,没错误,把值放到Ok(v)里面
part1/error_handler/src/main.rs:51
Functionread_yaml2
()
part2/read_yaml/src/main.rs:72
Functionredirect
(_req: Request<()>)
part5/tide-demo/src/main.rs:161
Methodredis_connection
(dsn: &str)
part3/redis-demo/src/main.rs:107
Functionredis_demo
()
part3/redis-demo/src/main.rs:125
Functionremove_cookie
(req: Request<()>)
part5/tide-demo/src/main.rs:178
Functionreq_block_v1
()
part1/reqwest-demo/src/main.rs:52
Functionrequest_block
()
part1/reqwest-demo/src/main.rs:43
Functionrequest_json_parse
()
part1/reqwest-demo/src/main.rs:61
Functionsay
(name: &str)
part1/my-mod2/src/front_of_house.rs:2
Methodsay_hello
( &self, _: ServerHandlerContext, req: ServerRequestSingle<HelloReq>, resp: Se
part7/grpc/grpc-hello/src/main.rs:12
Methodsay_hello
实现async_hello方法
part7/grpc/grpc-demo/src/main.rs:16
Methodsend_gzip
(mut self)
part7/grpc/grpc-demo/src/rust_grpc/app.grpc.hello.rs:75
Methodsend_gzip
(mut self)
part7/grpc/grpc-demo/src/rust_grpc/hello.rs:74
Methodserialize_message
(input: Self)
part3/pulsar-publish/src/main.rs:21
Methodserialize_message
(input: Self)
part3/pulsar-batch/src/main.rs:27
Functionset_cookie
Tide will use the the `Cookies`'s `Extract` implementation to build this parameter.
part5/tide-demo/src/main.rs:166
Methodset_id
Param is passed by value, moved
part7/grpc/grpc-hello/src/rust_grpc/hello.rs:58
Functionshow_form
form
part5/axum-demo/src/main.rs:121
Functionstatic_lifetime
静态生命周期 'static 生命周期存活在整个程序期间,直接存储在程序的二进制文件中 所有的字符串字面量都拥有 'static 生命周期 将一个引用声明为 'static 之前需要考虑清楚,是否要这么做
part1/generics_trait_lifetime/src/main.rs:395
Functionstring_demo
()
part1/collect/src/main.rs:151
Functionstruct_lifetimes
()
part1/generics_trait_lifetime/src/main.rs:435
Functionsubmit
% 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
Methodsummarize
(&self)
part1/trait_demo/src/main.rs:58
Methodsummarize_author
(&self)
part1/trait_demo/src/main.rs:65
Methodsummary
(&self)
part1/generics_trait_lifetime/src/main.rs:91
Methodtake_message
Take field
part7/grpc/grpc-hello/src/rust_grpc/hello.rs:289
Methodtake_name
Take field
part7/grpc/grpc-hello/src/rust_grpc/hello.rs:84
Functiontest_add
()
part1/unit_test/src/main.rs:26
Functiontest_add
()
part1/hello_world/src/main.rs:25
Functiontest_foo
()
part1/error_handler/src/main.rs:103
Functiontest_handle_connection
()
part4/tcp-http-demo/src/main.rs:133
Functiontest_json_macro
()
part2/serde_demo/src/main.rs:93
← previousnext →301–400 of 416, ranked by callers