Why can I omit the name of the module?

in file key.rs of rustls crate,it defines the pub struct Certificate(pub Vec)


then in lib.rs of rustls crate, it defines its interfaces
image

then we use the Certificate struct in mesalink like this
image

Why can it omit the the name "key" after rustls?

That's what pub use does - it reexports a type in a different location (in this case the root of the crate).

2 Likes

So every single "middle name " can be omitted, right ?

Yes, every one of those can be omitted when you import it into your project.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.