Issue
On https://github.com/sdroege/rtsp-server/blob/master/src/listener/message_socket.rs, it does
use crate::body::Body;
I could only find information about external crates: https://doc.rust-lang.org/reference/items/extern-crates.html
What does use crate::
mean?
Solution
It refers to to the crate currently being compiled. So in this example, it is resolved as rtsp_server::body::Body
. The body::Body
part is refering to the Body
item in the body
module.
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.
Answered By - Smitop Answer Checked By - Terry (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.