From 79d37a4e7b9266ff9782bd2546039e58b1a13d8a Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Wed, 26 Feb 2020 10:26:18 -0500 Subject: [PATCH] Add documentation to the Source and Dest value_len() and len() functions Signed-off-by: Alek Ratzloff --- src/vm/inst.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vm/inst.rs b/src/vm/inst.rs index f391a2e..9610985 100644 --- a/src/vm/inst.rs +++ b/src/vm/inst.rs @@ -164,6 +164,7 @@ pub enum Source { } impl Source { + /// The length of this source in its instruction. pub fn len(&self) -> usize { match self { Source::Addr64(_) | Source::Addr32(_) | Source::Addr16(_) | Source::Addr8(_) => 8, @@ -173,6 +174,7 @@ impl Source { } } + /// The length of the value that this source points to. pub fn value_len(&self) -> usize { match self { Source::Addr64(_) | Source::RegAddr64(_) | Source::Reg(_) | Source::Imm(_) => 8, @@ -213,6 +215,7 @@ pub enum Dest { } impl Dest { + /// The length of this destination in its instruction. pub fn len(&self) -> usize { match self { Dest::Addr64(_) | Dest::Addr32(_) | Dest::Addr16(_) | Dest::Addr8(_) => 8, @@ -221,6 +224,7 @@ impl Dest { } } + /// The length of the value that this destination points to. pub fn value_len(&self) -> usize { match self { Dest::Addr64(_) | Dest::RegAddr64(_) | Dest::Reg(_) => 8,