Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/daheige/rust-in-action
/ functions
Functions
1,131 in github.com/daheige/rust-in-action
⨍
Functions
1,131
◇
Types & classes
268
↓ 43 callers
Method
get
(&self, key: &str)
part11/qa-project/crates/qa-svc/src/infrastructure/cache/user_session.rs:16
↓ 40 callers
Method
clone
(&self)
part11/qa-project/crates/pb/src/qa.rs:1670
↓ 32 callers
Function
file_qa_proto_rawDescGZIP
()
part11/qa-project/clients/go/pb/qa.pb.go:1952
↓ 32 callers
Method
initOnce
()
part11/qa-project/clients/php/App/Grpc/GPBMetadata/Qa.php:12
↓ 30 callers
Method
from
(value: i32)
part5/from-into-convert/src/main.rs:9
↓ 22 callers
Method
execute
(&self, f: F)
part4/web-server/src/multi_server.rs:133
↓ 12 callers
Method
setUsername
* 用户名 * * Generated from protobuf field <code>string username = 1;</code> * @param string $var * @return $this */
part11/qa-project/clients/php/App/Grpc/Qa/UserLoginRequest.php:67
↓ 11 callers
Method
fetch_one
查询用户信息
part11/qa-project/crates/qa-svc/src/infrastructure/persistence/user.rs:58
↓ 11 callers
Method
getId
* 回答id * * Generated from protobuf field <code>uint64 id = 1;</code> * @return int|string */
part11/qa-project/clients/php/App/Grpc/Qa/AnswerEntity.php:87
↓ 11 callers
Method
setId
* 回答id * * Generated from protobuf field <code>uint64 id = 1;</code> * @param int|string $var * @return $this */
part11/qa-project/clients/php/App/Grpc/Qa/AnswerEntity.php:99
↓ 10 callers
Method
getUsername
* 用户名 * * Generated from protobuf field <code>string username = 1;</code> * @return string */
part11/qa-project/clients/php/App/Grpc/Qa/UserLoginRequest.php:55
↓ 8 callers
Method
add
插入用户
part11/qa-project/crates/qa-svc/src/infrastructure/persistence/user.rs:35
↓ 8 callers
Method
getState
* Generated from protobuf field <code>int64 state = 1;</code> * @return int|string */
part11/qa-project/clients/php/App/Grpc/Qa/UserLogoutReply.php:42
↓ 8 callers
Function
init
()
part11/qa-project/clients/go/pb/qa.pb.go:2037
↓ 8 callers
Method
setState
* Generated from protobuf field <code>int64 state = 1;</code> * @param int|string $var * @return $this */
part11/qa-project/clients/php/App/Grpc/Qa/UserLogoutReply.php:52
↓ 6 callers
Method
init
日志初始化 其中日志level优先级从高到低:error > warn > info > debug > trace
part11/qa-project/crates/infras/src/logger.rs:22
↓ 5 callers
Method
connect
Attempt to create a new client by connecting to a given endpoint.
part11/qa-project/crates/pb/src/qa.rs:353
↓ 5 callers
Method
getContent
* 回答内容 * * Generated from protobuf field <code>string content = 3;</code> * @return string */
part11/qa-project/clients/php/App/Grpc/Qa/AnswerEntity.php:139
↓ 5 callers
Method
getToken
* 登录成功返回的唯一标识token * * Generated from protobuf field <code>string token = 1;</code> * @return string */
part11/qa-project/clients/php/App/Grpc/Qa/UserLoginReply.php:47
↓ 5 callers
Function
graceful_shutdown
平滑退出处理,它是通过接收退出信号量的方式完成, 当接收到退出信号量时,程序会等待一段时间,再退出。 在这个退出期间,程序可以做一些其他的清理操作
part11/qa-project/crates/infras/src/shutdown.rs:7
↓ 5 callers
Function
pool
创建mysql pool 连接池
part11/qa-project/crates/qa-svc/src/config/mysql.rs:20
↓ 5 callers
Method
setContent
* 回答内容 * * Generated from protobuf field <code>string content = 3;</code> * @param string $var * @return $this */
part11/qa-project/clients/php/App/Grpc/Qa/AnswerEntity.php:151
↓ 4 callers
Method
getAnswer
* Generated from protobuf field <code>.qa.AnswerEntity answer = 1;</code> * @return \App\Grpc\Qa\AnswerEntity|null */
part11/qa-project/clients/php/App/Grpc/Qa/AddAnswerRequest.php:42
↓ 4 callers
Method
getCreatedBy
* 回答者 * * Generated from protobuf field <code>string created_by = 4;</code> * @return string */
part11/qa-project/clients/php/App/Grpc/Qa/AnswerEntity.php:165
↓ 4 callers
Function
pool
创建mysql pool 连接池
part7/article-svc/src/config/mysql.rs:18
↓ 4 callers
Method
setAnswer
* Generated from protobuf field <code>.qa.AnswerEntity answer = 1;</code> * @param \App\Grpc\Qa\AnswerEntity $var * @return $this */
part11/qa-project/clients/php/App/Grpc/Qa/AddAnswerRequest.php:62
↓ 4 callers
Method
setCreatedBy
* 回答者 * * Generated from protobuf field <code>string created_by = 4;</code> * @param string $var * @return $this */
part11/qa-project/clients/php/App/Grpc/Qa/AnswerEntity.php:177
↓ 4 callers
Method
setPassword
* 访问密码 * * Generated from protobuf field <code>string password = 2;</code> * @param string $var * @return $this */
part11/qa-project/clients/php/App/Grpc/Qa/UserLoginRequest.php:93
↓ 3 callers
Method
UserLogin
用户登录
part11/qa-project/clients/go/pb/qa_grpc.pb.go:46
↓ 3 callers
Method
UserRegister
用户注册
part11/qa-project/clients/go/pb/qa_grpc.pb.go:50
↓ 3 callers
Function
call
()
part2/super-self-demo/src/main.rs:36
↓ 3 callers
Function
check_image_type
根据文件名检查文件格式是否是PNG,JPEG,GIF三种类型的图片
part5/imgtool/src/utils.rs:6
↓ 3 callers
Method
consumer
消费点赞消息,并将数据持久化存储到mysql数据库对应的表中
part11/qa-project/crates/qa-svc/src/infrastructure/vote/user_vote.rs:267
↓ 3 callers
Method
deserialize
(deserializer: D)
part3/serde-custom/src/app.rs:34
↓ 3 callers
Method
getTitle
* 问题标题 * * Generated from protobuf field <code>string title = 2;</code> * @return string */
part11/qa-project/clients/php/App/Grpc/Qa/QuestionEntity.php:113
↓ 3 callers
Method
get_hash_key
(&self, target_type: &str)
part11/qa-project/crates/qa-svc/src/infrastructure/read_count/entity_read_count.rs:34
↓ 3 callers
Method
is_voted
( &self, target_id: u64, target_type: &str, username: &str, )
part11/qa-project/crates/qa-svc/src/infrastructure/vote/user_vote.rs:187
↓ 3 callers
Method
layer
(&self, service: S)
part11/qa-project/crates/qa-svc/src/middleware/access.rs:16
↓ 3 callers
Method
set
(&self, key: &str, user: &UserSessionEntity, seconds: u64)
part11/qa-project/crates/qa-svc/src/infrastructure/cache/user_session.rs:27
↓ 3 callers
Method
setTitle
* 问题标题 * * Generated from protobuf field <code>string title = 2;</code> * @param string $var * @return $this */
part11/qa-project/clients/php/App/Grpc/Qa/QuestionEntity.php:125
↓ 3 callers
Method
setToken
* 登录成功返回的唯一标识token * * Generated from protobuf field <code>string token = 1;</code> * @param string $var * @return $this */
part11/qa-project/clients/php/App/Grpc/Qa/UserLoginReply.php:59
↓ 3 callers
Function
str_to_bool
(s: &str)
part5/gen-table/src/main.rs:104
↓ 3 callers
Method
width
(&self)
bilibili/struct-demo/src/main.rs:35
↓ 3 callers
Method
with_connect_timeout
(mut self, timeout: Duration)
part11/qa-project/crates/infras/src/xredis.rs:63
↓ 3 callers
Method
with_idle_timeout
(mut self, timeout: Duration)
part11/qa-project/crates/infras/src/xredis.rs:58
↓ 3 callers
Method
with_max_lifetime
(mut self, lifetime: Duration)
part11/qa-project/crates/infras/src/xredis.rs:53
↓ 2 callers
Method
AddAnswer
添加问题回答
part11/qa-project/clients/go/pb/qa_grpc.pb.go:66
↓ 2 callers
Method
AddQuestion
发表问题
part11/qa-project/clients/go/pb/qa_grpc.pb.go:54
↓ 2 callers
Method
AnswerAgree
用户点赞回答和取消点赞
part11/qa-project/clients/go/pb/qa_grpc.pb.go:74
↓ 2 callers
Method
AnswerDetail
查看答案详情
part11/qa-project/clients/go/pb/qa_grpc.pb.go:72
↓ 2 callers
Method
AnswerList
回答列表
part11/qa-project/clients/go/pb/qa_grpc.pb.go:64
↓ 2 callers
Method
DeleteAnswer
删除问题对应的回答
part11/qa-project/clients/go/pb/qa_grpc.pb.go:68
↓ 2 callers
Method
DeleteQuestion
删除问题
part11/qa-project/clients/go/pb/qa_grpc.pb.go:56
↓ 2 callers
Method
LatestQuestions
最新问题列表(采用下拉分页形式获取数据,按照id desc倒序)
part11/qa-project/clients/go/pb/qa_grpc.pb.go:62
↓ 2 callers
Method
QuestionDetail
查看问题详情
part11/qa-project/clients/go/pb/qa_grpc.pb.go:60
↓ 2 callers
Method
UpdateAnswer
修改回答
part11/qa-project/clients/go/pb/qa_grpc.pb.go:70
↓ 2 callers
Method
UpdateQuestion
修改问题
part11/qa-project/clients/go/pb/qa_grpc.pb.go:58
↓ 2 callers
Method
UserLogout
用户退出
part11/qa-project/clients/go/pb/qa_grpc.pb.go:48
↓ 2 callers
Method
VerifyToken
验证登录的token是否有效
part11/qa-project/clients/go/pb/qa_grpc.pb.go:52
↓ 2 callers
Function
backup_database
数据库备份操作
part6/mysql-dump-cron/src/mysql.rs:9
↓ 2 callers
Function
buffer_and_print
( request_id: &str, prefix: &str, body: B, )
part11/qa-project/crates/gateway/src/middleware/request.rs:84
↓ 2 callers
Function
camel_case
(s: &str)
part5/gen-table/src/engine.rs:49
↓ 2 callers
Method
check_token
验证token是否有效,返回用户唯一标识openid
part11/qa-project/crates/qa-svc/src/application/qa.rs:67
↓ 2 callers
Function
check_user
检测用户是否存在
part8/points-svc/src/handlers/index.rs:197
↓ 2 callers
Function
client
创建pulsar client
part8/points-svc/src/config/xpulsar.rs:14
↓ 2 callers
Function
client
创建pulsar client
part11/qa-project/crates/qa-svc/src/config/xpulsar.rs:14
↓ 2 callers
Method
client
create pulsar client
part8/pulsar/pulsar-demo/src/xpulsar.rs:30
↓ 2 callers
Method
client
create redis client
part11/qa-project/crates/infras/src/xredis.rs:69
↓ 2 callers
Method
content
(&self)
part11/qa-project/crates/infras/src/config.rs:38
↓ 2 callers
Method
decrypt
Decrypt a buffer with the given key and iv using AES (128/192256)/CBC/Pkcs encryption. data 表示密文base64格式的字符串 返回明文字符串和解密的错误信息
part11/qa-project/crates/infras/src/aes.rs:69
↓ 2 callers
Method
delete
(&self, id: u64, username: &str)
part11/qa-project/crates/qa-svc/src/infrastructure/persistence/answer.rs:59
↓ 2 callers
Method
encrypt
Decrypt a buffer with the given key and iv using AES (128/192256)/CBC/Pkcs encryption. data 表示需要加密的字符串 返回的密文是将加密后的Vec<u8>转换为base64格式的字符串和对应的错误
part11/qa-project/crates/infras/src/aes.rs:37
↓ 2 callers
Function
factorial
实现n的阶乘,也就是1*2*3一直乘以到n的结果
part1/my_criterion/src/lib.rs:2
↓ 2 callers
Method
fetch_one
(&self, id: u64)
part11/qa-project/crates/qa-svc/src/infrastructure/persistence/answer.rs:96
↓ 2 callers
Function
first_word2
(s: &str)
bilibili/slice-demo/src/main.rs:53
↓ 2 callers
Function
foo
()
part2/super-self-demo/src/main.rs:22
↓ 2 callers
Function
gen_in_placeholder
根据len生成对应的(?,?,...)占位符,主要用于mysql where in (?,?)操作
part11/qa-project/crates/infras/src/sql_utils.rs:2
↓ 2 callers
Method
getAgreeCount
* 点赞数,添加时默认为0 * * Generated from protobuf field <code>uint64 agree_count = 5;</code> * @return int|string */
part11/qa-project/clients/php/App/Grpc/Qa/AnswerEntity.php:191
↓ 2 callers
Method
getIsEnd
* 数据是否到底了 * * Generated from protobuf field <code>bool is_end = 6;</code> * @return bool */
part11/qa-project/clients/php/App/Grpc/Qa/AnswerListReply.php:196
↓ 2 callers
Method
getLastId
* 上一次的question_id * * Generated from protobuf field <code>uint64 last_id = 2;</code> * @return int|string */
part11/qa-project/clients/php/App/Grpc/Qa/LatestQuestionsReply.php:82
↓ 2 callers
Method
getLimit
* 每页数据 * * Generated from protobuf field <code>uint64 limit = 3;</code> * @return int|string */
part11/qa-project/clients/php/App/Grpc/Qa/AnswerListRequest.php:123
↓ 2 callers
Method
getPassword
* 访问密码 * * Generated from protobuf field <code>string password = 2;</code> * @return string */
part11/qa-project/clients/php/App/Grpc/Qa/UserLoginRequest.php:81
↓ 2 callers
Method
getQuestion
* Generated from protobuf field <code>.qa.QuestionEntity question = 1;</code> * @return \App\Grpc\Qa\QuestionEntity|null */
part11/qa-project/clients/php/App/Grpc/Qa/QuestionDetailReply.php:42
↓ 2 callers
Method
getQuestionId
* 问题id * * Generated from protobuf field <code>uint64 question_id = 2;</code> * @return int|string */
part11/qa-project/clients/php/App/Grpc/Qa/AnswerEntity.php:113
↓ 2 callers
Method
getReason
* 操作提示信息 * * Generated from protobuf field <code>string reason = 2;</code> * @return string */
part11/qa-project/clients/php/App/Grpc/Qa/AnswerAgreeReply.php:93
↓ 2 callers
Method
get_columns
( &self, pool: &sqlx::MySqlPool, table: &str, )
part5/gen-table/src/engine.rs:192
↓ 2 callers
Function
get_header
get header by key
part11/qa-project/crates/gateway/src/utils/header.rs:4
↓ 2 callers
Function
get_type
get rust type by mysql type
part5/gen-table/src/sql_type.rs:55
↓ 2 callers
Function
hello
(name: &str)
bilibili/func-demo/src/main.rs:16
↓ 2 callers
Method
incr
(&self, data: &EntityReadCountData)
part11/qa-project/crates/qa-svc/src/infrastructure/read_count/entity_read_count.rs:88
↓ 2 callers
Method
init_pool
由于redis client和redis cluster client创建pool只是build的client不一样 所以这里可以采用泛型方法创建pool,这个泛型参数T满足ManageConnection trait特征就可以
part11/qa-project/crates/infras/src/xredis.rs:115
↓ 2 callers
Method
init_pool
由于redis client和redis cluster client创建pool只是build的client不一样 所以这里可以采用泛型方法创建pool,这个泛型参数T满足ManageConnection trait特征就可以
part7/article-svc/src/infras/xredis.rs:116
↓ 2 callers
Method
init_pool
由于redis client和redis cluster client创建pool只是build的client不一样 所以这里可以采用泛型方法创建pool,这个泛型参数T满足ManageConnection trait特征就可以
part7/redis-demo/src/xredis.rs:115
↓ 2 callers
Function
largest
(list: &[i32])
bilibili/largest-demo/src/main.rs:1
↓ 2 callers
Method
level
(&self)
bilibili/lifetimes-demo/src/main.rs:13
↓ 2 callers
Method
load
(&mut self)
part8/points-svc/src/infras/config.rs:30
↓ 2 callers
Function
max
求一个包含i32类型元素的切片中最大值
part2/my-lib/src/lib.rs:2
↓ 2 callers
Function
new_read_count_repo
创建一个ReadCountRepo实例对象
part11/qa-project/crates/qa-svc/src/infrastructure/read_count/entity_read_count.rs:15
↓ 2 callers
Function
new_vote_repo
( mysql_pool: sqlx::MySqlPool, pulsar_client: Pulsar<TokioExecutor>, )
part11/qa-project/crates/qa-svc/src/infrastructure/vote/user_vote.rs:18
↓ 2 callers
Function
notify
(item: &impl Summary)
bilibili/trait-demo/src/main.rs:54
next →
1–100 of 1,131, ranked by callers