trait Overload {
    fn overloaded(&self);
}

impl Overload for i32 {
    fn overloaded(&self) {
        println!("{}: int型です。", self);
    }
}

impl Overload for (f64, i32) {
    fn overloaded(&self) {
        println!("{:?}: タプル型です。", self);
    }
}

impl Overload for Vec<char> {
    fn overloaded(&self) {
        println!("{:?}: ベクター型です。", self);
    }
}

fn overloaded(f: &impl Overload) {
    f.overloaded();
}

fn main() {
    overloaded(&1);
    overloaded(&(1.0, 2));
    let v = vec!['a', 'b', 'c'];
    overloaded(&v);
}