pub trait CanFetch: Send + Sync + Sized {
fn borrows() -> Vec<Borrow>;
fn construct(loan_mngr: &mut LoanManager<'_>) -> Result<Self>;
fn plugin() -> Plugin { ... }
}Expand description
Types that can be fetched from the World.
Required Methods
fn borrows() -> Vec<Borrow>
sourcefn construct(loan_mngr: &mut LoanManager<'_>) -> Result<Self>
fn construct(loan_mngr: &mut LoanManager<'_>) -> Result<Self>
Attempt to construct Self with the given LoanManager.
Provided Methods
sourcefn plugin() -> Plugin
fn plugin() -> Plugin
Return a plugin containing the systems and sub-resources required to create and use the type.
This will be used by functions like World::with_plugin to ensure
that a type’s resources have been created, and that the systems
required for upkeep are included.