[−][src]Struct cpclib_sna::Snapshot
Snapshot V3 representation. Can be saved in snapshot V1 or v2.
Fields
debug: bool
Methods
impl Snapshot
[src]
pub fn log<S: Display>(&self, msg: S)
[src]
pub fn load<P: AsRef<Path>>(filename: P) -> Self
[src]
pub fn memory_size_header(&self) -> u16
[src]
pub fn version_header(&self) -> u8
[src]
pub fn fix_version(&self, version: SnapshotVersion) -> Self
[src]
Create a new snapshot that contains only information understandable by the required version TODO return an error in case of failure instead of panicing
pub fn nb_chunks(&self) -> usize
[src]
pub fn save_sna<P: AsRef<Path>>(&self, fname: P) -> Result<(), Error>
[src]
Save the snapshot V3 on disc
pub fn save<P: AsRef<Path>>(
&self,
fname: P,
version: SnapshotVersion
) -> Result<(), Error>
[src]
&self,
fname: P,
version: SnapshotVersion
) -> Result<(), Error>
pub fn write(
&self,
buffer: &mut File,
version: SnapshotVersion
) -> Result<(), Error>
[src]
&self,
buffer: &mut File,
version: SnapshotVersion
) -> Result<(), Error>
pub fn memory_dump(&self) -> Vec<u8>
[src]
Returns all the memory of the snapshot in a linear way by mixing both the hardcoded memory of the snapshot and the memory of chunks
pub fn has_memory_chunk(&self) -> bool
[src]
Check if the snapshot has some memory chunk
pub fn memory_block(&self) -> &SnapshotMemory
[src]
Returns the memory that is hardcoded in the snapshot
pub fn add_file(
&mut self,
fname: &str,
address: usize
) -> Result<(), SnapshotError>
[src]
&mut self,
fname: &str,
address: usize
) -> Result<(), SnapshotError>
Add the content of a file at the required position
pub fn add_data(
&mut self,
data: &[u8],
address: usize
) -> Result<(), SnapshotError>
[src]
&mut self,
data: &[u8],
address: usize
) -> Result<(), SnapshotError>
Add the memory content at the required posiiton
use cpclib_sna::Snapshot; let mut sna = Snapshot::default(); let data = vec![0,2,3,5]; sna.add_data(&data, 0x4000);
pub fn set_memory(&mut self, address: u32, value: u8)
[src]
Change a memory value. Panic if memory size is not appropriate If memory is saved insided chuncks, the chuncks are unwrapped
pub fn set_value(
&mut self,
flag: SnapshotFlag,
value: u16
) -> Result<(), SnapshotError>
[src]
&mut self,
flag: SnapshotFlag,
value: u16
) -> Result<(), SnapshotError>
Change the value of a flag
pub fn get_value(&self, flag: &SnapshotFlag) -> FlagValue
[src]
pub fn print_info(&self)
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Snapshot
impl Send for Snapshot
impl Sync for Snapshot
impl Unpin for Snapshot
impl UnwindSafe for Snapshot
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,