Add documentation to the Source and Dest value_len() and len() functions

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-02-26 10:26:18 -05:00
parent 44dc34e52d
commit 79d37a4e7b

View File

@@ -164,6 +164,7 @@ pub enum Source {
} }
impl Source { impl Source {
/// The length of this source in its instruction.
pub fn len(&self) -> usize { pub fn len(&self) -> usize {
match self { match self {
Source::Addr64(_) | Source::Addr32(_) | Source::Addr16(_) | Source::Addr8(_) => 8, 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 { pub fn value_len(&self) -> usize {
match self { match self {
Source::Addr64(_) | Source::RegAddr64(_) | Source::Reg(_) | Source::Imm(_) => 8, Source::Addr64(_) | Source::RegAddr64(_) | Source::Reg(_) | Source::Imm(_) => 8,
@@ -213,6 +215,7 @@ pub enum Dest {
} }
impl Dest { impl Dest {
/// The length of this destination in its instruction.
pub fn len(&self) -> usize { pub fn len(&self) -> usize {
match self { match self {
Dest::Addr64(_) | Dest::Addr32(_) | Dest::Addr16(_) | Dest::Addr8(_) => 8, 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 { pub fn value_len(&self) -> usize {
match self { match self {
Dest::Addr64(_) | Dest::RegAddr64(_) | Dest::Reg(_) => 8, Dest::Addr64(_) | Dest::RegAddr64(_) | Dest::Reg(_) => 8,