ref (if you could name the variable that, which you can't because ref is a keyword) has type &String, which as far as memory layout goes is a pointer to a pointer to bytes, unlike &str which is a pointer to bytes. (Both have a length, too.)
However, Rust will automatically coerce &String to &str when you try to use it as one, in most cases (such as passing it to another function or calling a method of it), so this is invisible until you start having more explicit types involved.