encore-dev 2.0.0-beta.21

Rust SDK for Encore applications
Documentation
//! Metadata about the running application — its environment, build, deployment,
//! API gateways, and frontends.
//!
//! ```ignore
//! let md = encore::env::app_meta();
//! if md.environment.r#type == encore::env::EnvironmentType::Production {
//!     // ...
//! }
//! // An app can declare several gateways, so look one up by name.
//! if let Some(gw) = md.gateway("api") {
//!     println!("api is at {}", gw.url);
//! }
//! ```

pub use encore_sdk_core::meta::{
    AppMeta, BuildMeta, CloudProvider, DeployMeta, EnvironmentMeta, EnvironmentType, FrontendMeta,
    GatewayMeta, HostedService,
};

/// Returns metadata about the running Encore application.
///
/// This is computed once when the runtime initializes (on first use of any
/// Encore resource), so repeated calls are inexpensive.
pub fn app_meta() -> &'static AppMeta {
    crate::runtime::core().app_meta()
}