How Are Crate API's are coded for rust lang : I was wondering how are crates for rust language are coded.

for example, there is a crate named num_cpus. This crate has this basic method num_cpus::get() which tells number of CPU in your computer. 

My questions 
- How the method num_cpus::get() is coded (is it done using other language) 
- Can the same result be achieved with plain rust code without using any crates
