Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 7-1: Confusion with library and binary #2820

Closed
2 tasks done
dcts opened this issue Aug 9, 2021 · 1 comment
Closed
2 tasks done

Chapter 7-1: Confusion with library and binary #2820

dcts opened this issue Aug 9, 2021 · 1 comment
Milestone

Comments

@dcts
Copy link

dcts commented Aug 9, 2021

  • I have checked the latest main branch to see if this has already been fixed
  • I have searched existing issues and pull requests for duplicates

URL to the section(s) of the book with this problem:
In 7-1 it is stated that:

A crate is a binary or library (source)

But its never actually described what the difference or characterization of those two is? I know what a binary is, but what is a library in this context? Doesn't a library also contain a binary? This is getting really confusing, at least for me as beginner.

Opening this issue in case I am not alone confused by this. :)

@dcts
Copy link
Author

dcts commented Aug 9, 2021

I found this useful explenation:

Rust programs may contain a binary crate or a library crate. A binary crate is an executable project that has a main() method. A library crate is a group of components that can be reused in other projects. Unlike a binary crate, a library crate does not have an entry point (main() method)

taken from tutorialspoint.

It would be great to add this to the the rust-book somewhere, especially it may be usefull to beginners :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants