pub struct MemoryMappingArena {
    addr: *mut u8,
    size: usize,
}
Expand description

Tracks Fixed Memory Maps within an anonymous memory-mapped fixed-sized arena in the current process.

Fields§

§addr: *mut u8§size: usize

Implementations§

Creates an mmap arena of size bytes.

Arguments
  • size - Size of memory region in bytes.

Anonymously maps size bytes at offset bytes from the start of the arena with prot protections. offset must be page aligned.

Arguments
  • offset - Page aligned offset into the arena in bytes.
  • size - Size of memory region in bytes.
  • prot - Protection (e.g. readable/writable) of the memory region.

Anonymously maps size bytes at offset bytes from the start of the arena. offset must be page aligned.

Arguments
  • offset - Page aligned offset into the arena in bytes.
  • size - Size of memory region in bytes.

Maps size bytes from the start of the given fd at offset bytes from the start of the arena. offset must be page aligned.

Arguments
  • offset - Page aligned offset into the arena in bytes.
  • size - Size of memory region in bytes.
  • fd - File descriptor to mmap from.

Maps size bytes starting at fs_offset bytes from within the given fd at offset bytes from the start of the arena. offset must be page aligned.

Arguments
  • offset - Page aligned offset into the arena in bytes.
  • size - Size of memory region in bytes.
  • fd - File descriptor to mmap from.
  • fd_offset - Offset in bytes from the beginning of fd to start the mmap.

Maps size bytes starting at fs_offset bytes from within the given fd at offset bytes from the start of the arena with prot protections. offset must be page aligned.

Arguments
  • offset - Page aligned offset into the arena in bytes.
  • size - Size of memory region in bytes.
  • fd - File descriptor to mmap from.
  • fd_offset - Offset in bytes from the beginning of fd to start the mmap.
  • prot - Protection (e.g. readable/writable) of the memory region.

Helper method that calls appropriate MemoryMapping constructor and adds the resulting map into the arena.

Removes size bytes at offset bytes from the start of the arena. offset must be page aligned.

Arguments
  • offset - Page aligned offset into the arena in bytes.
  • size - Size of memory region in bytes.

Trait Implementations§

Executes the destructor for this type. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Returns a pointer to the beginning of the memory region. Should only be used for passing this region to ioctls for setting guest memory.
Returns the size of the memory region in bytes.
Maps size bytes starting at fd_offset bytes from within the given fd at offset bytes from the start of the region with prot protections. offset must be page aligned. Read more
Remove size-byte mapping starting at offset.

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