What does use crate::body::Body; mean?

Viewed 1406
1 Answers

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.

The Rust documentation says:

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.

Related