What is the difference between &T and T in function signatures

T takes ownership of a value, while &T borrows it, allowing the caller to retain access.

In Rust function signatures, T represents ownership of a value (the caller moves the data into the function), while &T represents a reference (the caller borrows the data without moving it).

fn takes_ownership(x: String) {
    // x owns the String; caller cannot use it after this call
}

fn takes_borrow(x: &String) {
    // x borrows the String; caller can still use it after this call
}