std::subtract
Import with import std::subtract.
Exports
Section titled “Exports”Interfaces
interface Subtract
Section titled “interface Subtract”interface Subtract<Rhs, Out> fn subtract(lhs: self, rhs: Rhs) -> Out end
The interface behind the - operator: lhs - rhs is
Subtract.subtract(lhs, rhs).
The implementing type (self) is the left operand. Rhs is the right
operand’s type and Out the result’s, so an impl can return a type
other than its left operand’s.
pub type DateDay Int pub type Days Int impl Subtract<Days, DateDay> for DateDay fn subtract(lhs: DateDay, rhs: Days) -> DateDay ... end end
Subtract.subtract
Section titled “Subtract.subtract”fn subtract(lhs: self, rhs: Rhs) -> Out
interface Subtract