Update to last Rust api.

`as_c_str` is now a method.
`as_buf` is replaced by the method `as_imm_buf`.