Skip to content

Commit 5cd9258

Browse files
committed
Update documentation about the new architecture tag
1 parent 445e43a commit 5cd9258

File tree

16 files changed

+67
-26
lines changed

16 files changed

+67
-26
lines changed

capstone-rs/src/arch/arm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub use capstone_sys::arm_cc as ArmCC;
2323
pub use capstone_sys::arm_mem_barrier as ArmMemBarrier;
2424
pub use capstone_sys::arm_setend_type as ArmSetendType;
2525

26+
/// Architecture tag that represents ARM.
2627
pub struct ArmArchTag;
2728

2829
impl ArchTagSealed for ArmArchTag {}

capstone-rs/src/arch/arm64.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ pub use capstone_sys::arm64_barrier_op as Arm64BarrierOp;
2929
use capstone_sys::cs_arm64_op__bindgen_ty_2;
3030
use capstone_sys::arm64_shifter;
3131

32+
/// Architecture tag that represents ARM64.
3233
pub struct Arm64ArchTag;
3334

3435
impl ArchTagSealed for Arm64ArchTag {}

capstone-rs/src/arch/evm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use crate::arch::{ArchTag, DetailsArchInsn};
1414
use crate::arch::internal::ArchTagSealed;
1515
use crate::{Arch, InsnDetail, RegIdInt};
1616

17+
/// Architecture tag that represents EVM.
1718
pub struct EvmArchTag;
1819

1920
impl ArchTagSealed for EvmArchTag {}

capstone-rs/src/arch/m680x.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use crate::arch::internal::ArchTagSealed;
1717
use crate::instruction::RegId;
1818
use crate::{Arch, InsnDetail};
1919

20+
/// Architecture tag that represents M680X.
2021
pub struct M680xArchTag;
2122

2223
impl ArchTagSealed for M680xArchTag {}

capstone-rs/src/arch/m68k.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use crate::instruction::{RegId, RegIdInt};
2020
use crate::prelude::*;
2121
use crate::{Arch, Error, InsnDetail};
2222

23+
/// Architecture tag that represents M68K.
2324
pub struct M68kArchTag;
2425

2526
impl ArchTagSealed for M68kArchTag {}

capstone-rs/src/arch/mips.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use crate::arch::internal::ArchTagSealed;
1515
use crate::instruction::RegId;
1616
use crate::{Arch, InsnDetail};
1717

18+
/// Architecture tag that represents MIPS.
1819
pub struct MipsArchTag;
1920

2021
impl ArchTagSealed for MipsArchTag {}

capstone-rs/src/arch/mod.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,17 +354,30 @@ mod internal {
354354

355355
/// Provides types relative to a specific arch.
356356
pub trait ArchTag: internal::ArchTagSealed + 'static + Sized {
357-
/// Type of capstone builder that builds Capstone instances for this architecture.
357+
/// Type of capstone builder that builds [`Capstone`] instances for this architecture.
358+
///
359+
/// Objects of this type are returned from the `Capstone::new` function.
358360
type Builder: Default;
359361

362+
/// Type that represents the disassembler's mode.
360363
type Mode: Copy + Into<Mode>;
364+
365+
/// Type that represents the disassembler's extra modes.
361366
type ExtraMode: Copy + Into<ExtraMode>;
367+
368+
/// Type that represents the disassembler's syntax specifier.
362369
type Syntax: Copy + Into<Syntax>;
363370

371+
/// Type that represents the registers provided by the architecture.
364372
type RegId: Copy + From<RegId> + Into<RegId>;
373+
374+
/// Type that represents the instruction IDs provided by the architecture.
365375
type InsnId: Copy + Into<InsnId>;
376+
377+
/// Type that represents the instruction group IDs provided by the architecture.
366378
type InsnGroupId: Copy + From<InsnGroupId> + Into<InsnGroupId>;
367379

380+
/// Type that provides detailed information about an instruction under the architecture.
368381
type InsnDetail<'a>: DetailsArchInsn + for<'i> From<&'i InsnDetail<'a, Self>>;
369382

370383
/// Determine whether the given [`Arch`] value is supported by this arch tag.

capstone-rs/src/arch/ppc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use crate::arch::internal::ArchTagSealed;
1616
use crate::instruction::RegId;
1717
use crate::{Arch, InsnDetail};
1818

19+
/// Architecture tag that represents PPC.
1920
pub struct PpcArchTag;
2021

2122
impl ArchTagSealed for PpcArchTag {}

capstone-rs/src/arch/riscv.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use crate::arch::internal::ArchTagSealed;
1414
use crate::instruction::{RegId, RegIdInt};
1515
use crate::{Arch, InsnDetail};
1616

17+
/// Architecture tag that represents RISC-V.
1718
pub struct RiscVArchTag;
1819

1920
impl ArchTagSealed for RiscVArchTag {}

capstone-rs/src/arch/sparc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use crate::arch::internal::ArchTagSealed;
1616
use crate::instruction::{RegId, RegIdInt};
1717
use crate::{Arch, InsnDetail};
1818

19+
/// Architecture tag that represents Sparc.
1920
pub struct SparcArchTag;
2021

2122
impl ArchTagSealed for SparcArchTag {}

0 commit comments

Comments
 (0)