trunk
Erin 2024-02-16 12:17:15 +01:00
parent eb46b24a10
commit 6c6e29479f
1 changed files with 8 additions and 0 deletions

View File

@ -127,6 +127,14 @@ macro_rules! gen_opcodes {
[< $mnemonic:lower:camel >](super::[<Ops $ty>]),
)* }
impl Op {
pub fn size(&self) -> usize {
(match self {
$(Self::[<$mnemonic:lower:camel>] { .. } => core::mem::size_of::<super::[<Ops $ty>]>(),)*
}) + 1
}
}
impl crate::Encodable for Op {
fn encode(self, buffer: &mut impl crate::Buffer) {
match self {