什么用 crate::body::Body;意思?
What does use crate::body::Body; mean?
在 https://github.com/sdroege/rtsp-server/blob/master/src/listener/message_socket.rs 上,
use crate::body::Body;
我只能找到有关外部包装箱的信息:https://doc.rust-lang.org/reference/items/extern-crates.html
use crate::
是什么意思?
指的是当前正在编译的crate。所以在这个例子中,它被解析为rtsp_server::body::Body
。 body::Body
部分是指 body
模块的 Body
struct/enum。
crate
is also used to represent the absolute path of a module, where crate
refers to the
root of the current crate. For instance, crate::foo::bar
refers to the name bar
inside the
module foo
, from anywhere else in the same crate.
在 https://github.com/sdroege/rtsp-server/blob/master/src/listener/message_socket.rs 上,
use crate::body::Body;
我只能找到有关外部包装箱的信息:https://doc.rust-lang.org/reference/items/extern-crates.html
use crate::
是什么意思?
指的是当前正在编译的crate。所以在这个例子中,它被解析为rtsp_server::body::Body
。 body::Body
部分是指 body
模块的 Body
struct/enum。
crate
is also used to represent the absolute path of a module, wherecrate
refers to the root of the current crate. For instance,crate::foo::bar
refers to the namebar
inside the modulefoo
, from anywhere else in the same crate.