[−][src]Struct keeshond_datapack::DataStore
Storage that allows lookup and access of DataObjects of a given type
Methods
impl<T: DataObject + 'static> DataStore<T>
[src]
pub fn new(source_manager: Rc<RefCell<SourceManager>>) -> DataStore<T>
[src]
Constructs a new DataStore that gets its Sources from the given SourceManager
pub fn load_package(
&mut self,
package_name: &str
) -> Result<DataStoreOk, DataError>
[src]
&mut self,
package_name: &str
) -> Result<DataStoreOk, DataError>
Loads the package by the given name if it is not already loaded.
pub fn get_id(
&self,
package_name: &str,
pathname: &str
) -> Result<DataId, DataError>
[src]
&self,
package_name: &str,
pathname: &str
) -> Result<DataId, DataError>
Gets the numeric ID of the DataObject from the given package at the given pathname.
pub fn get_id_mut(
&mut self,
package_name: &str,
pathname: &str
) -> Result<DataId, DataError>
[src]
&mut self,
package_name: &str,
pathname: &str
) -> Result<DataId, DataError>
Gets the numeric ID of the DataObject from the given package at the given pathname. If the package is not loaded, it will be loaded automatically.
pub fn get(&self, index: DataId) -> Option<&T>
[src]
Returns a reference to the DataObject by the given DataId, if one exists. Otherwise returns None.
pub fn get_mut(&mut self, index: DataId) -> Option<&mut T>
[src]
Returns a mutable reference to the DataObject by the given DataId, if one exists. Otherwise returns None.
pub fn unload_package(&mut self, package_name: &str) -> bool
[src]
Unloads the given package from memory. Any DataObjects will be dropped, but pathname-id mappings will be retained in memory so that existing references will not be invalidated. Returns true if the package was loaded.
pub fn unload_all(&mut self)
[src]
Unloads all packages from memory. Any DataObjects will be dropped, but pathname-id mappings will be retained in memory so that existing references will not be invalidated. Returns true if the package was loaded.
pub fn package_loaded(&self, package_name: &str) -> bool
[src]
Returns true if the given package is loaded.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,