pub trait HasEnvironment {
type EnvironmentType: Environment;
// Required method
fn GetEnvironment(&self) -> Arc<Self::EnvironmentType>;
}Expand description
A generic trait for any type that holds a shared, reference-counted pointer
to an Environment.
This is primarily implemented by the ApplicationRunTime, which needs to
provide access to the MountainEnvironment it manages so that
ActionEffects can be executed with the correct context and capabilities.
Required Associated Types§
Sourcetype EnvironmentType: Environment
type EnvironmentType: Environment
The specific, concrete type of the Environment this struct holds.
Required Methods§
Sourcefn GetEnvironment(&self) -> Arc<Self::EnvironmentType>
fn GetEnvironment(&self) -> Arc<Self::EnvironmentType>
Gets a shared, reference-counted pointer to the environment.
Implementations on Foreign Types§
Source§impl<T: HasEnvironment> HasEnvironment for Arc<T>
A blanket implementation for Arc<T>. This allows code to treat
an Arc<TRunTime> as if it were TRunTime for the purpose of getting the
environment. This is required by the blanket impl ApplicationRunTime for Arc<TRunTime> which has a where Self: HasEnvironment bound.
impl<T: HasEnvironment> HasEnvironment for Arc<T>
A blanket implementation for Arc<T>. This allows code to treat
an Arc<TRunTime> as if it were TRunTime for the purpose of getting the
environment. This is required by the blanket impl ApplicationRunTime for Arc<TRunTime> which has a where Self: HasEnvironment bound.