HasEnvironment

Trait HasEnvironment 

Source
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§

Source

type EnvironmentType: Environment

The specific, concrete type of the Environment this struct holds.

Required Methods§

Source

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.

Implementors§