Most of the issues appear to be some pointer definition mismatch for dirent...
Rust does not have a core type that is directly equivalent to the c type char, instead it has a type alias core:ffi::c_char (also rexported as std::ffi::c_char) which, depending on the target platform, is an alias for either i8 or u8.
Since it's an alias, and not a fully distinct type (unlike isize/usize which *are* distinct types) you can mix i8 with c_char on platforms where the c char type is signed, and mix u8 with c_char on platforms where the c type char is unsigned, but doing so will result in unportable code.