#[repr(transparent)]
pub struct Address(_);
Expand description

This type represents a address on the target system. It internally holds a umem value but can also be used when working in 32-bit environments.

This type will not handle overflow for 32-bit or 64-bit addresses / lengths.

Implementations

A address with the value of zero.

Examples
use memflow::types::Address;

println!("address: {}", Address::NULL);

A address with an invalid value.

Examples
use memflow::types::Address;

println!("address: {}", Address::INVALID);

Returns an address with a value of zero.

Examples
use memflow::types::Address;

println!("address: {}", Address::null());

Creates a a bit mask. This function accepts an (half-open) range excluding the end bit from the mask.

Examples
use memflow::types::Address;

println!("mask: {}", Address::bit_mask(0..11));

Creates a a bit mask (const version with u8 range). This function accepts an (half-open) range excluding the end bit from the mask.

Examples
use memflow::types::Address;

println!("mask: {}", Address::bit_mask(0..11));

Checks wether the address is zero or not.

Examples
use memflow::types::Address;

assert_eq!(Address::null().is_null(), true);
assert_eq!(Address::from(0x1000u64).is_null(), false);

Converts the address to an Option that is None when it is null

Examples
use memflow::types::Address;

assert_eq!(Address::null().non_null(), None);
assert_eq!(Address::from(0x1000u64).non_null(), Some(Address::from(0x1000)));

Returns an address with a invalid value.

Examples
use memflow::types::Address;

println!("address: {}", Address::invalid());

Checks wether the address is valid or not.

Examples
use memflow::types::Address;

assert_eq!(Address::invalid().is_valid(), false);
assert_eq!(Address::from(0x1000u64).is_valid(), true);

Converts the address into a u64 value.

Examples
use memflow::types::{Address, umem};

let addr = Address::from(0x1000u64);
let addr_umem: umem = addr.to_umem();
assert_eq!(addr_umem, 0x1000);

Aligns the containing address to the given page size. It returns the base address of the containing page.

Examples
use memflow::types::{Address, mem};

let addr = Address::from(0x1234);
let aligned = addr.as_mem_aligned(mem::kb(4));
assert_eq!(aligned, Address::from(0x1000));

Returns true or false wether the bit at the specified index is either 0 or 1. An index of 0 will check the least significant bit.

Examples
use memflow::types::Address;

let addr = Address::from(2);
let bit = addr.bit_at(1);
assert_eq!(bit, true);

Extracts the given range of bits by applying a corresponding bitmask. This function accepts an (half-open) range excluding the end bit from the mask.

Examples
use memflow::types::Address;

let addr = Address::from(123456789);
println!("bits[0..2] = {}", addr.extract_bits(0..2));

Wrapping (modular) addition. Computes self + rhs, wrapping around at the boundary of the type.

Wrapping (modular) subtraction. Computes self - rhs, wrapping around at the boundary of the type.

Trait Implementations

Adds any compatible type reference to Address

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Implements byteswapping for the address

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns a address with a value of zero.

Examples

use memflow::types::Address;

assert_eq!(Address::default().is_null(), true);

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Converts a PhysicalAddress into a Address.

Performs the conversion.

Performs the conversion.

Converts a PhysicalAddress into a Address.

Performs the conversion.

Converts any Pointer into an Address.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Converts any PrimitiveAddress into an Address.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Formats the value using the given formatter.

Retrieves page table address by virtual address

Retrieves page table address, and its index by index within For instance, on Arm index 257 would return kernel page table address, and index 1. On X86, however, this is a no-op that returns underlying page table Address and idx. Read more

Retrieves number of page tables used by translation base. 1 on X86, 1-2 on Arm (Win32 Arm merges both page tables) Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Serialize this value into the given Serde serializer. Read more

Whether this type has a single invalid bit-pattern. Read more

The layout of the type provided by implementors.

const-equivalents of the associated types.

Subtracts any compatible type reference to Address

The resulting type after applying the - operator.

Performs the - operation. Read more

Subtracts a Address from a Address resulting in a umem.

Examples

use memflow::types::Address;

assert_eq!(Address::from(10) - 5, Address::from(5));

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Formats the value using the given formatter.

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

The owned type, stored in RCow::Owned

The borrowed type, stored in RCow::Borrowed

Performs the conversion.

This is always WithMetadata_<Self, Self>

Performs the conversion.

Gets a reference to a field, determined by offset. Read more

Gets a muatble reference to a field, determined by offset. Read more

Gets a const pointer to a field, the field is determined by offset. Read more

Gets a mutable pointer to a field, determined by offset. Read more

Replaces a field (determined by offset) with value, returning the previous value of the field. Read more

Swaps a field (determined by offset) with the same field in right. Read more

Gets a copy of a field (determined by offset). The field is determined by offset. Read more

Replaces a field (determined by offset) with value, returning the previous value of the field. Read more

Swaps a field (determined by offset) with the same field in right. Read more

Gets a copy of a field (determined by offset). The field is determined by offset. Read more

Compares the address of self with the address of other. Read more

Emulates the pipeline operator, allowing method syntax in more places. Read more

The same as piped except that the function takes &Self Useful for functions that take &Self instead of Self. Read more

The same as piped, except that the function takes &mut Self. Useful for functions that take &mut Self instead of Self. Read more

Mutates self using a closure taking self by mutable reference, passing it along the method chain. Read more

Observes the value of self, passing it along unmodified. Useful in long method chains. Read more

Performs a conversion with Into. using the turbofish .into_::<_>() syntax. Read more

Performs a reference to reference conversion with AsRef, using the turbofish .as_ref_::<_>() syntax. Read more

Performs a mutable reference to mutable reference conversion with AsMut, using the turbofish .as_mut_::<_>() syntax. Read more

Drops self using method notation. Alternative to std::mem::drop. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

Transmutes the element type of this pointer.. 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.

This is always Self.

Converts a value back to the original type.

Converts a reference back to the original type.

Converts a mutable reference back to the original type.

Converts a box back to the original type.

Converts an Arc back to the original type. Read more

Converts an Rc back to the original type. Read more

Converts a value back to the original type.

Converts a reference back to the original type.

Converts a mutable reference back to the original type.

Converts a box back to the original type.

Converts an Arc back to the original type.

Converts an Rc back to the original type.