This is a serious pause for me

what is string::from() ?
is it a function or a keyword ?
where is it defined ?
from which library ?

It comes from an implementation of From trait for String, defined in the standard library.

saying standard library adds more complexity , which library the standard is vast

The one that's part of the language, literally called std.

In case the term ‚Äústandard library‚ÄĚ isn‚Äôt clear, see the homepage of std docs:

The Rust Standard Library

The Rust Standard Library is the foundation of portable Rust software, a set of minimal and battle-tested shared abstractions for the broader Rust ecosystem. It offers core types, like Vec<T> and Option<T>, library-defined operations on language primitives, standard macros, I/O and multithreading, among many other things.

std is available to all Rust crates by default. Therefore, the standard library can be accessed in use statements through the path std, as in use std::env.

1 Like

No, there seems to be a misconception. None of these are part of the ‚Äústandard library‚ÄĚ, instead these libraries, tokio, clap, log, egui, are all third-party crates/libraries.


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.