pub enum HmiConfig {
Cog {
dist: String,
debug_url: Option<String>,
},
Pocket {
bundle: String,
pak: String,
logical_width: u32,
logical_height: u32,
},
}Expand description
Compile-time HMI carrier the builder injects as environment variables before
invoking the application cargo build. The consuming runtime crate reads
them with option_env! at compile time, so the values are on-target paths
resolved beneath [profile] deploy_root — the build host never dereferences
them.
The engine tag selects which variables are emitted:
Variants§
Cog
Cog/WPE WebKit shell serving a static dist directory via csti://.
Fields
Native PocketJS shell loading a built bundle + pak from on-target paths.
Implementations§
Source§impl HmiConfig
impl HmiConfig
Sourcepub fn from_hmi(hmi: &Hmi, deploy_root: &str) -> Self
pub fn from_hmi(hmi: &Hmi, deploy_root: &str) -> Self
Builds the compile-time HMI carrier from the parsed [hmi] section.
Because the build host and the target are different machines, every value
is an on-target path a downstream packaging recipe installs assets to.
Relative install locations are resolved beneath deploy_root (the
manifest’s [profile] deploy_root convention): Cog serves
{deploy_root}/www, and PocketJS loads {deploy_root}/hmi/<app>.{js,pak}.
Callers must have validated hmi (see Hmi::validate); a PocketJS
section without app falls back to an empty name here.
Sourcepub fn env_pairs(&self) -> Vec<(String, String)>
pub fn env_pairs(&self) -> Vec<(String, String)>
Environment variables the builder injects for this config.
Consuming crates read these with option_env! at compile time. For Cog,
CONSORTIUM_HMI_DEBUG_URL is emitted only when set, so its absence lets
debug builds fall back to the static csti:// handler.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HmiConfig
impl<'de> Deserialize<'de> for HmiConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for HmiConfig
impl StructuralPartialEq for HmiConfig
Auto Trait Implementations§
impl Freeze for HmiConfig
impl RefUnwindSafe for HmiConfig
impl Send for HmiConfig
impl Sync for HmiConfig
impl Unpin for HmiConfig
impl UnsafeUnpin for HmiConfig
impl UnwindSafe for HmiConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.