[][src]Struct iced_x86::MemorySizeInfo

pub struct MemorySizeInfo { /* fields omitted */ }

MemorySize information

Implementations

impl MemorySizeInfo[src]

#[must_use]pub fn memory_size(&self) -> MemorySize[src]

Gets the MemorySize value

Examples

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

#[must_use]pub fn size(&self) -> usize[src]

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!(4, info.size());
let info = MemorySize::Packed256_UInt16.info();
assert_eq!(32, info.size());
let info = MemorySize::Broadcast512_UInt64.info();
assert_eq!(8, info.size());

#[must_use]pub fn element_size(&self) -> usize[src]

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!(4, info.element_size());
let info = MemorySize::Packed256_UInt16.info();
assert_eq!(2, info.element_size());
let info = MemorySize::Broadcast512_UInt64.info();
assert_eq!(8, info.element_size());

#[must_use]pub fn element_type(&self) -> MemorySize[src]

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!(MemorySize::UInt32, info.element_type());
let info = MemorySize::Packed256_UInt16.info();
assert_eq!(MemorySize::UInt16, info.element_type());
let info = MemorySize::Broadcast512_UInt64.info();
assert_eq!(MemorySize::UInt64, info.element_type());

#[must_use]pub fn element_type_info(&self) -> &'static Self[src]

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!(MemorySize::UInt32, info.memory_size());
let info = MemorySize::Packed256_UInt16.info().element_type_info();
assert_eq!(MemorySize::UInt16, info.memory_size());
let info = MemorySize::Broadcast512_UInt64.info().element_type_info();
assert_eq!(MemorySize::UInt64, info.memory_size());

#[must_use]pub fn is_signed(&self) -> bool[src]

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

#[must_use]pub fn is_broadcast(&self) -> bool[src]

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

#[must_use]pub fn is_packed(&self) -> bool[src]

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

#[must_use]pub fn element_count(&self) -> usize[src]

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!(1, info.element_count());
let info = MemorySize::Packed256_UInt16.info();
assert_eq!(16, info.element_count());
let info = MemorySize::Broadcast512_UInt64.info();
assert_eq!(1, info.element_count());

Trait Implementations

impl Clone for MemorySizeInfo[src]

impl Copy for MemorySizeInfo[src]

impl Debug for MemorySizeInfo[src]

impl Eq for MemorySizeInfo[src]

impl Hash for MemorySizeInfo[src]

impl PartialEq<MemorySizeInfo> for MemorySizeInfo[src]

impl StructuralEq for MemorySizeInfo[src]

impl StructuralPartialEq for MemorySizeInfo[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.