Skip to main content

Double

Trait Double 

Source
pub trait Double: Sized {
    // Required method
    fn double(&self) -> Self;

    // Provided method
    fn double_in_place(&mut self) { ... }
}
Expand description

Perform a doubling (i.e. self + self).

Required Methods§

Source

fn double(&self) -> Self

Double this value, returning the doubled result.

Provided Methods§

Source

fn double_in_place(&mut self)

Double this value in-place, assigning self + self to self.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§