[][src]Struct sunrise_libkern::MemoryState

pub struct MemoryState {
    bits: u32,
}

Represents the current state of a memory region: why is it allocated, and what operations are allowed.

Fields

bits: u32

Implementations

impl MemoryState[src]

pub const TY: MemoryState[src]

The low 8 bits are used to keep the type.

pub const PERMISSION_CHANGE_ALLOWED: MemoryState[src]

Allows the use of svcSetMemoryPermissions on this memory region.

pub const FORCE_READ_WRITABLE_BY_DEBUG_SYSCALLS: MemoryState[src]

Allow writing to read-only segments with svcWriteDebugProcessMemory.

pub const IPC_SEND_ALLOWED: MemoryState[src]

Allows sending this region over IPC.

pub const NON_DEVICE_IPC_SEND_ALLOWED: MemoryState[src]

Allows sending this region over IPC with buffer flag set to 1.

pub const NON_SECURE_IPC_SEND_ALLOWED: MemoryState[src]

Allows sending this region over IPC with buffer flag set to 3.

pub const PROCESS_PERMISSION_CHANGE_ALLOWED: MemoryState[src]

Allows the use of svcSetProcessMemoryPermission on this memory region.

pub const MAP_ALLOWED: MemoryState[src]

Allows remapping this memory region with svcMapMemory.

pub const UNMAP_PROCESS_CODE_MEMORY_ALLOWED: MemoryState[src]

Allows unmapping this memory region through svcUnmapProcessCodeMemory.

pub const TRANSFER_MEMORY_ALLOWED: MemoryState[src]

Allows creating Transfer Memory from this memory region with svcCreateTransferMemory.

pub const QUERY_PHYSICAL_ADDRESS_ALLOWED: MemoryState[src]

Allows using query_physical_memory on this memory region.

pub const MAP_DEVICE_ALLOWED: MemoryState[src]

Allows mapping this memory region to a DeviceAddressSpace through either svcMapDeviceAddressSpace or svcMapDeviceAddressSpaceByForce.

pub const MAP_DEVICE_ALIGNED_ALLOWED: MemoryState[src]

Allows mapping this memory region to a DeviceAddressSpace through svcMapDeviceAddressSpaceAligned.

pub const IPC_BUFFER_ALLOWED: MemoryState[src]

Allows using this memory region as an IPC Command Buffer.

pub const IS_REFERENCE_COUNTED: MemoryState[src]

If true, this memory region is reference counted/pool-allocated.

pub const MAP_PROCESS_ALLOWED: MemoryState[src]

Allows mapping this region accross process boundary through svcMapProcessMemory

pub const ATTRIBUTE_CHANGE_ALLOWED: MemoryState[src]

Allows using the svcSetMemoryAttribute syscall on this memory region.

pub const CODE_MEMORY_ALLOWED: MemoryState[src]

Allows creating a CodeMemory backed by this memory region.

pub const ALL_IPC_SEND_ALLOWED: MemoryState[src]

All IPC Buffer Send permissions are allowed by this type.

pub const CAN_IOMMU: MemoryState[src]

This type can use all IOMMU-related permissions (MapDevice allowed, MapDeviceAligned allowed, and QueryPhysicalAddress allowed).

pub const fn empty() -> MemoryState[src]

Returns an empty set of flags

pub const fn all() -> MemoryState[src]

Returns the set containing all flags.

pub const fn bits(&self) -> u32[src]

Returns the raw value of the flags currently stored.

pub fn from_bits(bits: u32) -> Option<MemoryState>[src]

Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.

pub const fn from_bits_truncate(bits: u32) -> MemoryState[src]

Convert from underlying bit representation, dropping any bits that do not correspond to flags.

pub const fn is_empty(&self) -> bool[src]

Returns true if no flags are currently stored.

pub const fn is_all(&self) -> bool[src]

Returns true if all flags are currently set.

pub const fn intersects(&self, other: MemoryState) -> bool[src]

Returns true if there are flags common to both self and other.

pub const fn contains(&self, other: MemoryState) -> bool[src]

Returns true all of the flags in other are contained within self.

pub fn insert(&mut self, other: MemoryState)[src]

Inserts the specified flags in-place.

pub fn remove(&mut self, other: MemoryState)[src]

Removes the specified flags in-place.

pub fn toggle(&mut self, other: MemoryState)[src]

Toggles the specified flags in-place.

pub fn set(&mut self, other: MemoryState, value: bool)[src]

Inserts or removes the specified flags depending on the passed value.

impl MemoryState[src]

pub fn ty(self) -> MemoryType[src]

MemoryType this state represents.

Trait Implementations

impl Binary for MemoryState[src]

impl BitAnd<MemoryState> for MemoryState[src]

type Output = MemoryState

The resulting type after applying the & operator.

fn bitand(self, other: MemoryState) -> MemoryState[src]

Returns the intersection between the two sets of flags.

impl BitAndAssign<MemoryState> for MemoryState[src]

fn bitand_assign(&mut self, other: MemoryState)[src]

Disables all flags disabled in the set.

impl BitOr<MemoryState> for MemoryState[src]

type Output = MemoryState

The resulting type after applying the | operator.

fn bitor(self, other: MemoryState) -> MemoryState[src]

Returns the union of the two sets of flags.

impl BitOrAssign<MemoryState> for MemoryState[src]

fn bitor_assign(&mut self, other: MemoryState)[src]

Adds the set of flags.

impl BitXor<MemoryState> for MemoryState[src]

type Output = MemoryState

The resulting type after applying the ^ operator.

fn bitxor(self, other: MemoryState) -> MemoryState[src]

Returns the left flags, but with all the right flags toggled.

impl BitXorAssign<MemoryState> for MemoryState[src]

fn bitxor_assign(&mut self, other: MemoryState)[src]

Toggles the set of flags.

impl Clone for MemoryState[src]

impl Copy for MemoryState[src]

impl Debug for MemoryState[src]

impl Default for MemoryState[src]

impl Eq for MemoryState[src]

impl Extend<MemoryState> for MemoryState[src]

impl FromIterator<MemoryState> for MemoryState[src]

impl Hash for MemoryState[src]

impl LowerHex for MemoryState[src]

impl Not for MemoryState[src]

type Output = MemoryState

The resulting type after applying the ! operator.

fn not(self) -> MemoryState[src]

Returns the complement of this set of flags.

impl Octal for MemoryState[src]

impl Ord for MemoryState[src]

impl PartialEq<MemoryState> for MemoryState[src]

impl PartialOrd<MemoryState> for MemoryState[src]

impl StructuralEq for MemoryState[src]

impl StructuralPartialEq for MemoryState[src]

impl Sub<MemoryState> for MemoryState[src]

type Output = MemoryState

The resulting type after applying the - operator.

fn sub(self, other: MemoryState) -> MemoryState[src]

Returns the set difference of the two sets of flags.

impl SubAssign<MemoryState> for MemoryState[src]

fn sub_assign(&mut self, other: MemoryState)[src]

Disables all flags enabled in the set.

impl UpperHex for MemoryState[src]

Auto Trait Implementations

impl Send for MemoryState

impl Sync for MemoryState

impl Unpin for MemoryState

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, 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.