# Environment in maplibre::environment - Rust
The environment defines which types must be injected into maplibre at compile time. Essentially, this trait implements the dependency injection design pattern. By instantiating this trait at compile time with concrete types, it is possible to create different compile-time instances of maplibre.

# Trait maplibre::environment::Environment

source ·

    pub trait Environment: 'static {
        type MapWindowConfig: MapWindowConfig;
        type AsyncProcedureCall: AsyncProcedureCall<Self::OffscreenKernelEnvironment>;
        type Scheduler: Scheduler;
        type HttpClient: HttpClient;
        type OffscreenKernelEnvironment: OffscreenKernelEnvironment;
    }

Expand description

The environment defines which types must be injected into maplibre at compile time. Essentially, this trait implements the dependency injection design pattern. By instantiating this trait at compile time with concrete types, it is possible to create different compile-time instances of maplibre.

For example it is possible to change the way tasks are scheduled. It is also possible to change the HTTP implementation for fetching tiles over the network.

## Required Associated Types§

source

#### type MapWindowConfig: MapWindowConfig

source

#### type AsyncProcedureCall: AsyncProcedureCall<Self::OffscreenKernelEnvironment>

source

#### type Scheduler: Scheduler

source

#### type HttpClient: HttpClient

source

#### type OffscreenKernelEnvironment: OffscreenKernelEnvironment

## Object Safety§

This trait is not object safe.

## Implementors§