Struct SplitDests
pub struct SplitDests<A: Arch> { /* private fields */ }
Expand description
Splits dests into smaller, non-overlapping chunks.
§Example
use liblisa::arch::x64::{GpReg, X64Arch, X64Reg};
use liblisa::encoding::dataflows::{Dest, Size};
use liblisa::state::SplitDests;
const Rax: X64Reg = X64Reg::GpReg(GpReg::Rax);
let mut split = SplitDests::<X64Arch>::new();
split.split(Dest::Reg(Rax, Size::new(0, 3)));
split.split(Dest::Reg(Rax, Size::new(2, 5)));
assert_eq!(
split
.get(Dest::Reg(Rax, Size::new(2, 5)))
.collect::<Vec<_>>(),
vec![
Dest::Reg(Rax, Size::new(2, 3)),
Dest::Reg(Rax, Size::new(4, 5)),
]
)
Implementations§
§impl<A: Arch> SplitDests<A>
impl<A: Arch> SplitDests<A>
pub fn new() -> Self
pub fn new() -> Self
Creates an empty SplitDests
.
pub fn split(&mut self, dest: Dest<A>)
pub fn split(&mut self, dest: Dest<A>)
Splits the location in dest
into non-overlapping chunks.
If the location has not been inserted before, the entire size is added as one chunk.
If the location has been inserted before, the sizes are split such that only subsets
of one or more of the previously inserted Dest
s are included.
Trait Implementations§
§impl<A: Clone + Arch> Clone for SplitDests<A>
impl<A: Clone + Arch> Clone for SplitDests<A>
§fn clone(&self) -> SplitDests<A>
fn clone(&self) -> SplitDests<A>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl<A: Debug + Arch> Debug for SplitDests<A>
impl<A: Debug + Arch> Debug for SplitDests<A>
§impl<A: Default + Arch> Default for SplitDests<A>
impl<A: Default + Arch> Default for SplitDests<A>
§fn default() -> SplitDests<A>
fn default() -> SplitDests<A>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<A> Freeze for SplitDests<A>
impl<A> RefUnwindSafe for SplitDests<A>
impl<A> Send for SplitDests<A>
impl<A> Sync for SplitDests<A>
impl<A> Unpin for SplitDests<A>
impl<A> UnwindSafe for SplitDests<A>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more