Comment

Comment by masklinn

There is since that's what you declared.

    impl Foo {
        // static
        fn foo() {}
    }

    impl Foo {
        // instance, owned
        fn foo(self) {}
    }

    impl Foo {
        // instance, borrowed
        fn foo(&self) {}
    }

    impl Foo {
        // instance, boxed
        fn foo(self: Box<Self>) {}
    }

    impl Foo {
        // instance, refcounted
        fn foo(self: Rc<Self>) {}
    }
parent masklinn 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton