pub struct Database {
pub programs: Vec<Program>,
pub hashes: HashMap<String, usize>,
}
Expand description
Database contains the full contents of the CHIP-8 database, minus any disabled features.
Fields§
§programs: Vec<Program>
A list of all known programs written for a CHIP-8 platform.
hashes: HashMap<String, usize>
A map of all known ROM hashes, used to index into [programs].
Implementations§
Source§impl Database
impl Database
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new instance of the DB. Does not touch the filesystem or network.
Sourcepub fn get_metadata(&self, rom: &[u8]) -> Metadata
pub fn get_metadata(&self, rom: &[u8]) -> Metadata
Lookup the metadata for a specific ROM file by hashing it.
Sourcepub fn get_metadata_from_hash(&self, hash: &str) -> Metadata
pub fn get_metadata_from_hash(&self, hash: &str) -> Metadata
Lookup the metadata for a specific hash string.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Database
impl RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnwindSafe for Database
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