pub struct MemoryInit {
pub address: u16,
pub values: Vec<u8>,
}Expand description
Represents a memory initialization operation
Fields§
§address: u16Starting address
values: Vec<u8>Values to write starting at address
Implementations§
Source§impl MemoryInit
impl MemoryInit
Sourcepub fn parse(s: &str) -> Result<Self, String>
pub fn parse(s: &str) -> Result<Self, String>
Parse a memory init string in format ADDR=VALUE or ADDR=V1,V2,...
§Examples
use monsoon_cli::cli::memory_init::MemoryInit;
let init = MemoryInit::parse("0x0050=0xFF").unwrap();
assert_eq!(init.address, 0x0050);
assert_eq!(init.values, vec![0xFF]);
let init = MemoryInit::parse("0x6000=0x01,0x02,0x03").unwrap();
assert_eq!(init.address, 0x6000);
assert_eq!(init.values, vec![0x01, 0x02, 0x03]);Trait Implementations§
Source§impl Clone for MemoryInit
impl Clone for MemoryInit
Source§fn clone(&self) -> MemoryInit
fn clone(&self) -> MemoryInit
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MemoryInit
impl RefUnwindSafe for MemoryInit
impl Send for MemoryInit
impl Sync for MemoryInit
impl Unpin for MemoryInit
impl UnsafeUnpin for MemoryInit
impl UnwindSafe for MemoryInit
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more