Struct iced_x86::MemorySizeInfo
source · [−]pub struct MemorySizeInfo { /* private fields */ }
Expand description
MemorySize
information
Implementations
sourceimpl MemorySizeInfo
impl MemorySizeInfo
sourcepub fn memory_size(&self) -> MemorySize
pub fn memory_size(&self) -> MemorySize
Gets the MemorySize
value
Examples
use iced_x86::*;
let info = MemorySize::Packed256_UInt16.info();
assert_eq!(info.memory_size(), MemorySize::Packed256_UInt16);
sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Gets the size in bytes of the memory location or 0 if it’s not accessed or unknown
Examples
use iced_x86::*;
let info = MemorySize::UInt32.info();
assert_eq!(info.size(), 4);
let info = MemorySize::Packed256_UInt16.info();
assert_eq!(info.size(), 32);
let info = MemorySize::Broadcast512_UInt64.info();
assert_eq!(info.size(), 8);
sourcepub fn element_size(&self) -> usize
pub fn element_size(&self) -> usize
Gets the size in bytes of the packed element. If it’s not a packed data type, it’s equal to size()
.
Examples
use iced_x86::*;
let info = MemorySize::UInt32.info();
assert_eq!(info.element_size(), 4);
let info = MemorySize::Packed256_UInt16.info();
assert_eq!(info.element_size(), 2);
let info = MemorySize::Broadcast512_UInt64.info();
assert_eq!(info.element_size(), 8);
sourcepub fn element_type(&self) -> MemorySize
pub fn element_type(&self) -> MemorySize
Gets the element type if it’s packed data or the type itself if it’s not packed data
Examples
use iced_x86::*;
let info = MemorySize::UInt32.info();
assert_eq!(info.element_type(), MemorySize::UInt32);
let info = MemorySize::Packed256_UInt16.info();
assert_eq!(info.element_type(), MemorySize::UInt16);
let info = MemorySize::Broadcast512_UInt64.info();
assert_eq!(info.element_type(), MemorySize::UInt64);
sourcepub fn element_type_info(&self) -> &'static Self
pub fn element_type_info(&self) -> &'static Self
Gets the element type if it’s packed data or the type itself if it’s not packed data
Examples
use iced_x86::*;
let info = MemorySize::UInt32.info().element_type_info();
assert_eq!(info.memory_size(), MemorySize::UInt32);
let info = MemorySize::Packed256_UInt16.info().element_type_info();
assert_eq!(info.memory_size(), MemorySize::UInt16);
let info = MemorySize::Broadcast512_UInt64.info().element_type_info();
assert_eq!(info.memory_size(), MemorySize::UInt64);
sourcepub fn is_signed(&self) -> bool
pub fn is_signed(&self) -> bool
true
if it’s signed data (signed integer or a floating point value)
Examples
use iced_x86::*;
let info = MemorySize::UInt32.info();
assert!(!info.is_signed());
let info = MemorySize::Int32.info();
assert!(info.is_signed());
let info = MemorySize::Float64.info();
assert!(info.is_signed());
sourcepub fn is_broadcast(&self) -> bool
pub fn is_broadcast(&self) -> bool
true
if it’s a broadcast memory type
Examples
use iced_x86::*;
let info = MemorySize::UInt32.info();
assert!(!info.is_broadcast());
let info = MemorySize::Packed256_UInt16.info();
assert!(!info.is_broadcast());
let info = MemorySize::Broadcast512_UInt64.info();
assert!(info.is_broadcast());
sourcepub fn is_packed(&self) -> bool
pub fn is_packed(&self) -> bool
true
if this is a packed data type, eg. MemorySize::Packed128_Float32
. See also element_count()
Examples
use iced_x86::*;
let info = MemorySize::UInt32.info();
assert!(!info.is_packed());
let info = MemorySize::Packed256_UInt16.info();
assert!(info.is_packed());
let info = MemorySize::Broadcast512_UInt64.info();
assert!(!info.is_packed());
sourcepub fn element_count(&self) -> usize
pub fn element_count(&self) -> usize
Gets the number of elements in the packed data type or 1
if it’s not packed data (is_packed()
)
Examples
use iced_x86::*;
let info = MemorySize::UInt32.info();
assert_eq!(info.element_count(), 1);
let info = MemorySize::Packed256_UInt16.info();
assert_eq!(info.element_count(), 16);
let info = MemorySize::Broadcast512_UInt64.info();
assert_eq!(info.element_count(), 1);
Trait Implementations
sourceimpl Clone for MemorySizeInfo
impl Clone for MemorySizeInfo
sourcefn clone(&self) -> MemorySizeInfo
fn clone(&self) -> MemorySizeInfo
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for MemorySizeInfo
impl Debug for MemorySizeInfo
sourceimpl Hash for MemorySizeInfo
impl Hash for MemorySizeInfo
sourceimpl PartialEq<MemorySizeInfo> for MemorySizeInfo
impl PartialEq<MemorySizeInfo> for MemorySizeInfo
sourcefn eq(&self, other: &MemorySizeInfo) -> bool
fn eq(&self, other: &MemorySizeInfo) -> bool
impl Copy for MemorySizeInfo
impl Eq for MemorySizeInfo
impl StructuralEq for MemorySizeInfo
impl StructuralPartialEq for MemorySizeInfo
Auto Trait Implementations
impl RefUnwindSafe for MemorySizeInfo
impl Send for MemorySizeInfo
impl Sync for MemorySizeInfo
impl Unpin for MemorySizeInfo
impl UnwindSafe for MemorySizeInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more