logo
pub struct MemorySizeInfo { /* private fields */ }
Expand description

MemorySize information

Implementations

Gets the MemorySize value

Examples
use iced_x86::*;
let info = MemorySize::Packed256_UInt16.info();
assert_eq!(info.memory_size(), MemorySize::Packed256_UInt16);

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);

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);

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);

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);

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());

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());

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());

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

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.