Method Receiver

    • &self: borrows the object from the caller using a shared and immutable reference. The object can be used again afterwards.
    • : takes ownership of the object and moves it away from the caller. The method becomes the owner of the object. The object will be dropped (deallocated) when the method returns, unless its ownership is explicitly transmitted.
    • No receiver: this becomes a static method on the struct. Typically used to create constructors which are called new by convention.