From d77c2448e35291c933bdf876c2d1d357c86cd6f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Autin?= Date: Wed, 29 Mar 2023 15:40:35 +0200 Subject: [PATCH] :memo: Commented trait RegisterNum --- src/simulator/register.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/simulator/register.rs b/src/simulator/register.rs index 339c0e5..bbad262 100644 --- a/src/simulator/register.rs +++ b/src/simulator/register.rs @@ -6,6 +6,14 @@ use crate::simulator::machine::{NUM_FP_REGS, NUM_INT_REGS}; use std::ops::{Add, Sub}; +/// Forcing the Register struct's generic type into having the following Traits +/// +/// - Add +/// - Sub +/// - PartialEq +/// - Copy +/// +/// Generally speaking, only numbers have the combinaison of these traits. pub trait RegisterNum: Add + Sub + PartialEq + Copy {} impl RegisterNum for i64 {}