pub struct RomManager {
pub roms: Vec<RomMeta>,
/* private fields */
}Fields§
§roms: Vec<RomMeta>Implementations§
Source§impl RomManager
impl RomManager
pub fn new(base: PathBuf) -> RomManager
Sourcepub fn load(&mut self, definitions: &Definitions) -> Result<()>
pub fn load(&mut self, definitions: &Definitions) -> Result<()>
Loads rom metadata
Sourcepub fn search(&self, id: &str) -> Option<&RomMeta>
pub fn search(&self, id: &str) -> Option<&RomMeta>
Searches for a ROM meta with the specified id
Sourcepub fn new_rom(
&mut self,
name: String,
id: String,
platform: Rc<Main>,
model: Rc<Model>,
data: Vec<u8>,
) -> Rc<Rom>
pub fn new_rom( &mut self, name: String, id: String, platform: Rc<Main>, model: Rc<Model>, data: Vec<u8>, ) -> Rc<Rom>
Creates a new ROM, adds it to the database. It will NOT be saved.
Note: save_meta() should be called as the ROM metadata will not be saved by this function.
Rom::save() should also be called to save the ROM data.
If another ROM with the same id already exists, undefined behavior will occur.
Auto Trait Implementations§
impl !Freeze for RomManager
impl !RefUnwindSafe for RomManager
impl !Send for RomManager
impl !Sync for RomManager
impl !UnwindSafe for RomManager
impl Unpin for RomManager
impl UnsafeUnpin for RomManager
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> 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