📝 Commented trait RegisterNum
This commit is contained in:
parent
72f560f3ec
commit
d77c2448e3
@ -6,6 +6,14 @@
|
|||||||
use crate::simulator::machine::{NUM_FP_REGS, NUM_INT_REGS};
|
use crate::simulator::machine::{NUM_FP_REGS, NUM_INT_REGS};
|
||||||
use std::ops::{Add, Sub};
|
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<Output=Self> + Sub<Output=Self> + PartialEq + Copy {}
|
pub trait RegisterNum: Add<Output=Self> + Sub<Output=Self> + PartialEq + Copy {}
|
||||||
|
|
||||||
impl RegisterNum for i64 {}
|
impl RegisterNum for i64 {}
|
||||||
|
Loading…
Reference in New Issue
Block a user