pub struct Space {
pub name: Option<Box<str>>,
pub word_size: usize,
pub addr_size: usize,
pub ty: SpaceType,
}Expand description
A named, uniformly-addressed memory region.
Each space has a word size (bytes per addressable unit) and an address size (bytes needed to hold a pointer into the space). For most RAM spaces these are 1 and 8 respectively on a 64-bit architecture.
Fields§
§name: Option<Box<str>>Optional human-readable name (e.g. "ram", "register").
word_size: usizeThe size of a memory location with a single address in this space, in bytes.
addr_size: usizeThe size of addresses in this space, in bytes.
ty: SpaceTypeThe kind of this space.
Implementations§
Source§impl Space
impl Space
Sourcepub fn new(name: Option<&str>, word_size: usize, addr_size: usize) -> Self
pub fn new(name: Option<&str>, word_size: usize, addr_size: usize) -> Self
Creates a new RAM space with the given name (or anonymous if None),
word size, and address size.
Sourcepub fn unique(addr_size: usize) -> Self
pub fn unique(addr_size: usize) -> Self
Creates the unique space used for instruction-local p-code temporaries.
Sourcepub fn from_id<S: SpaceStore + ?Sized>(src: &S, id: SpaceId) -> SpaceRef<'_>
pub fn from_id<S: SpaceStore + ?Sized>(src: &S, id: SpaceId) -> SpaceRef<'_>
Builds a space reference from an id, against any SpaceStore.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Space
impl<'de> Deserialize<'de> for Space
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Space
impl RefUnwindSafe for Space
impl Send for Space
impl Sync for Space
impl Unpin for Space
impl UnsafeUnpin for Space
impl UnwindSafe for Space
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more