Struct iced_x86::MemorySizeInfo
source · pub struct MemorySizeInfo { /* private fields */ }
Expand description
MemorySize
information
Implementations§
source§impl MemorySizeInfo
impl MemorySizeInfo
sourcepub const fn memory_size(&self) -> MemorySize
pub const 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 const fn size(&self) -> usize
pub const 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 const fn element_size(&self) -> usize
pub const 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 const fn element_type(&self) -> MemorySize
pub const 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 const fn is_signed(&self) -> bool
pub const 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 const fn is_broadcast(&self) -> bool
pub const 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 const fn is_packed(&self) -> bool
pub const 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 const fn element_count(&self) -> usize
pub const 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§
source§impl Clone for MemorySizeInfo
impl Clone for MemorySizeInfo
source§fn clone(&self) -> MemorySizeInfo
fn clone(&self) -> MemorySizeInfo
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 moresource§impl Debug for MemorySizeInfo
impl Debug for MemorySizeInfo
source§impl Hash for MemorySizeInfo
impl Hash for MemorySizeInfo
source§impl PartialEq for MemorySizeInfo
impl PartialEq for MemorySizeInfo
source§fn eq(&self, other: &MemorySizeInfo) -> bool
fn eq(&self, other: &MemorySizeInfo) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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§
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