MCPcopy Create free account

hub / github.com/daheige/rust-bible / types & classes

Types & classes143 in github.com/daheige/rust-bible

↓ 2 callersClassMessage
part3/pulsar-batch/src/main.rs:21
↓ 1 callersClassAudio
part1/super_player/src/main.rs:36
↓ 1 callersClassColor
可以格式化打印
part1/compound_type/src/main.rs:47
↓ 1 callersClassFoo
part1/memory/ownship/src/main.rs:2
↓ 1 callersClassLogger
part1/memory/lifetime/src/main.rs:97
↓ 1 callersClassPerson
part1/advanced_concept/src/main.rs:25
↓ 1 callersClassSayHelloSvc
part7/grpc/grpc-demo/src/rust_grpc/app.grpc.hello.rs:168
↓ 1 callersClassSayHelloSvc
part7/grpc/grpc-demo/src/rust_grpc/hello.rs:167
↓ 1 callersClassValidatedForm
part5/axum-demo/src/main.rs:165
↓ 1 callersClassVideo
part1/super_player/src/main.rs:37
↓ 1 callersClass_Inner
part7/grpc/grpc-demo/src/rust_grpc/app.grpc.hello.rs:125
↓ 1 callersClass_Inner
part7/grpc/grpc-demo/src/rust_grpc/hello.rs:124
ClassAnimal
part5/tide-demo/src/main.rs:10
ClassAnimal
part1/reqwest-demo/src/main.rs:25
ClassAppService
part6/clap-demo/src/main.rs:8
EnumAppetizer
part1/my-mod/src/main.rs:26
ClassApple
part1/trait_bound/src/intro.rs:71
InterfaceArea
这里定义的Area trait继承了Debug特征,然后接着定义了一个方法get_area
part1/trait_object/src/main.rs:14
ClassArt
part1/generics_trait_lifetime/src/main.rs:82
ClassBag
part1/borrwer/src/main.rs:12
ClassBagInfo
part1/cell_demo/src/main.rs:59
ClassBob
part1/trait_bound/src/intro.rs:122
ClassBreakFast
如果我们在一个结构体定义的前面使用了 pub ,这个结构体会变成公有的, 但是这个结构体的字段仍然是私有的。我们可以根据情况决定每个字段是否公有。
part1/my-mod/src/main.rs:4
ClassCacher
定义泛型结构体Cacher calculation 类型是一个函数闭包 value 是一个option 存放函数T闭包执行的结果
part1/closures/src/main.rs:149
InterfaceCar
对于Car trait的具体实现者必须要实现Vehicle上的get_price方法 ===rust特征与其他语言的接口存在很大差异=== 1.在rust中类型本身并没有任何继承。因此采用的是类型组合而不是对象继承,它依赖 于特征继承来为代码中的任何实际的实体建模。 2.可以在任何地方编写特征实现的
part1/super_player/src/car.rs:15
ClassCli
part6/clap-regular-use/src/main.rs:7
InterfaceCode
part1/trait_bound/src/intro.rs:100
EnumCoin
part1/match_demo/src/main.rs:7
EnumColor
part1/generics_trait_lifetime/src/main.rs:68
EnumCommands
part6/clap-regular-use/src/main.rs:36
InterfaceComparable
比较操作trait
part1/generics_trait_lifetime/src/main.rs:190
ClassConf
part2/read_yaml/src/main.rs:55
ClassContainer
part1/generics_demo/src/main.rs:8
EnumContainer
part1/advanced_concept/src/main.rs:27
ClassContainerInfo
part1/advanced_concept/src/main.rs:32
ClassCounter
实现 Iterator trait 来创建自定义迭代器
part1/iterators/src/main.rs:50
ClassCreateUserReq
part5/axum-demo/src/main.rs:59
ClassCreateUserReq
part7/web/rs-api/src/router/api.rs:13
InterfaceDateLogger
定义日期格式logger
part6/shaku-inject-demo/src/main.rs:10
InterfaceDateLogger
part6/inject-demo/src/main.rs:8
ClassDateLoggerImpl
part6/shaku-inject-demo/src/main.rs:29
ClassDateLoggerImpl
part6/inject-demo/src/main.rs:21
ClassDecoder
多个生命周期 假设我们在使用一个解码器,它根据模式和给定的已编码字节流来解析二进制文件
part1/memory/lifetime/src/main.rs:63
ClassDelay
自定义一个Future实现 1. 等待某个特定时间点的到来 2. 在标准输出打印文本 3. 生成一个字符串
part4/async-tokio-demo/src/main.rs:153
InterfaceDescriptive
特征作为返回值
part1/generics_trait_lifetime/src/main.rs:223
ClassDoubleLinkedList
part1/link_demo/src/main.rs:84
ClassDummy
part1/memory/ownship/src/main.rs:5
ClassDummyInfo
part1/memory/ownship/src/main.rs:10
InterfaceEat
== 使用“+”将特征组合为区间==
part1/trait_bound/src/intro.rs:94
InterfaceEatable
泛型函数和impl代码块上的特征区间 定义eat trait特征
part1/trait_bound/src/intro.rs:57
ClassEmptyObject
part7/web/rs-api/src/router/api.rs:31
ClassEnemy
part1/trait_bound/src/intro.rs:5
EnumEvent
part4/a-chat/src/server.rs:116
ClassFooRef
生命周期纯粹是一个编译期构造,它可以帮助编译器确定某个引用有效的作用域,并 确保它遵循借用规则。它可以跟踪诸如引用的来源,以及它们是否比借用值生命周期更长 这类事情。Rust 中的生命周期能够确保引用的存续时间不超过它指向的值。生命周期并不 是你作为开发人员将要用到的,而是编译器使用和推断引用的有效
part1/memory/lifetime/src/main.rs:7
ClassFood
part1/trait_bound/src/intro.rs:62
EnumFood
part1/advanced_concept/src/main.rs:7
EnumFood
part1/borrwer/src/main.rs:5
ClassGame
part1/trait_bound/src/intro.rs:4
ClassGreeterImpl
part7/grpc/grpc-demo/src/main.rs:11
InterfaceGreeterService
part7/grpc/grpc-hello/src/rust_grpc/hello_grpc.rs:24
InterfaceGreeterService
part7/grpc/grpc-demo/src/rust_grpc/app.grpc.hello.rs:112
InterfaceGreeterService
part7/grpc/grpc-demo/src/rust_grpc/hello.rs:111
ClassGreeterServiceClient
part7/grpc/grpc-hello/src/rust_grpc/hello_grpc.rs:30
ClassGreeterServiceClient
part7/grpc/grpc-demo/src/rust_grpc/app.grpc.hello.rs:26
ClassGreeterServiceClient
part7/grpc/grpc-demo/src/rust_grpc/hello.rs:25
ClassGreeterServiceImpl
实现grpc service
part7/grpc/grpc-hello/src/main.rs:9
ClassGreeterServiceServer
part7/grpc/grpc-hello/src/rust_grpc/hello_grpc.rs:56
ClassGreeterServiceServer
part7/grpc/grpc-demo/src/rust_grpc/app.grpc.hello.rs:120
ClassGreeterServiceServer
part7/grpc/grpc-demo/src/rust_grpc/hello.rs:119
ClassHelloReply
part7/grpc/grpc-hello/src/rust_grpc/hello.rs:221
ClassHelloReply
part7/grpc/grpc-demo/src/rust_grpc/app.grpc.hello.rs:14
ClassHelloReply
part7/grpc/grpc-demo/src/rust_grpc/hello.rs:13
ClassHelloReq
part7/grpc/grpc-hello/src/rust_grpc/hello.rs:27
ClassHelloReq
part7/grpc/grpc-demo/src/rust_grpc/app.grpc.hello.rs:5
ClassHelloReq
part7/grpc/grpc-demo/src/rust_grpc/hello.rs:4
ClassHero
part1/trait_bound/src/intro.rs:6
ClassIncrement
part4/async-tokio-demo/src/main.rs:16
ClassInput
part5/axum-demo/src/main.rs:147
InterfaceIntoMapTrait
定义IntoMap trait
part1/macro/into_map_demo/into_map/src/lib.rs:2
EnumLevel
part1/memory/lifetime/src/main.rs:91
ClassLinkedList
part1/link_demo/src/main.rs:15
ClassLinkedListNode
part1/link_demo/src/main.rs:77
InterfaceLoadable
定义trait
part1/trait_bound/src/intro.rs:23
InterfaceLogger
定义接口 其实 pub Interface = Any + Send + Sync
part6/shaku-inject-demo/src/main.rs:5
InterfaceLogger
手动处理依赖问题
part6/inject-demo/src/main.rs:4
ClassLoggerImpl
part6/shaku-inject-demo/src/main.rs:17
ClassLoggerImpl
part6/inject-demo/src/main.rs:12
ClassMessage
part3/pulsar-publish/src/main.rs:16
ClassMessage
part3/pulsar-consumer/src/main.rs:17
ClassMockTcpStream
模拟tcp stream
part4/tcp-http-demo/src/main.rs:85
ClassNode
part1/link_demo/src/main.rs:9
ClassNumberInfo
part1/memory/lifetime/src/main.rs:42
ClassOrder
part1/advanced_concept/src/main.rs:19
ClassParam
part7/job/cron-demo/src/main.rs:5
EnumPaymentMode
part1/advanced_concept/src/main.rs:13
ClassPerson
part1/macro/into_map_demo/src/main.rs:13
ClassPerson
part1/generics_trait_lifetime/src/main.rs:231
InterfacePlayable
定义特征trait 对于Playable必须用pub公开来修饰,这样别的地方use media 才可以使用Playable trait 在默认情况下,特征是私有的。要能够被其他模块或其他软件包调用,它们需要被声明为公有的。
part1/super_player/src/media.rs:4
ClassPoint
part2/serde_demo/src/main.rs:7
ClassPoint
part2/read_yaml/src/main.rs:49
next →1–100 of 143, ranked by callers