The ToBase64 trait seems to have an implementation for &[u8], but it's not found by the compiler.
Indeed, it is not found by the compiler in your code because you're not importing it. In order to use trait implementations, you have to import the trait itself:
extern mod extra;
fn main() {
use extra::base64::{ToBase64, MIME};
let mut config = MIME;
config.line_length = None;
let foo = ::std::os::args()[1];
print(foo.as_bytes().to_base64(config));
}
(I've changed args()[0]
to args()[1]
since it is more interesting to encode command line arguments instead of executable name only :))