pub enum WickConfiguration {
Component(ComponentConfiguration),
App(AppConfiguration),
Types(TypesConfiguration),
Tests(TestConfiguration),
Lockdown(LockdownConfiguration),
}Expand description
A catch-all enum for root-level Wick configurations.
Variants§
Component(ComponentConfiguration)
A component_config::ComponentConfiguration configuration.
App(AppConfiguration)
An app_config::AppConfiguration configuration.
Types(TypesConfiguration)
A types_config::TypesConfiguration configuration.
Tests(TestConfiguration)
A test_config::TestConfiguration configuration.
Lockdown(LockdownConfiguration)
A lockdown_config::LockdownConfiguration configuration.
Implementations§
Source§impl WickConfiguration
impl WickConfiguration
Sourcepub async fn fetch_tree(
path: impl Into<AssetReference> + Send,
root_config: Option<RuntimeConfig>,
root_env: Option<HashMap<String, String>>,
options: FetchOptions,
) -> Result<ConfigurationTreeNode<WickConfiguration>, Error>
pub async fn fetch_tree( path: impl Into<AssetReference> + Send, root_config: Option<RuntimeConfig>, root_env: Option<HashMap<String, String>>, options: FetchOptions, ) -> Result<ConfigurationTreeNode<WickConfiguration>, Error>
Fetch a configuration and all referenced assets from a path.
§Example
use wick_config::WickConfiguration;
use wick_asset_reference::FetchOptions;
let opts = FetchOptions::default();
let env : HashMap<String,String> = std::env::vars().collect();
let root_config = None;
let manifest = WickConfiguration::fetch_tree("path/to/manifest.yaml", root_config, env, opts).await?;Sourcepub async fn fetch_uninitialized_tree(
path: impl Into<AssetReference> + Send,
options: FetchOptions,
) -> Result<ConfigurationTreeNode<UninitializedConfiguration>, Error>
pub async fn fetch_uninitialized_tree( path: impl Into<AssetReference> + Send, options: FetchOptions, ) -> Result<ConfigurationTreeNode<UninitializedConfiguration>, Error>
Fetch a configuration and all referenced assets from a path.
§Example
use wick_config::WickConfiguration;
use wick_asset_reference::FetchOptions;
let opts = FetchOptions::default();
let manifest = WickConfiguration::fetch_uninitialized_tree("path/to/manifest.yaml", opts).await?;Sourcepub async fn fetch(
asset: impl Into<AssetReference> + Send,
options: FetchOptions,
) -> Result<UninitializedConfiguration, Error>
pub async fn fetch( asset: impl Into<AssetReference> + Send, options: FetchOptions, ) -> Result<UninitializedConfiguration, Error>
Fetch a configuration from a path.
§Example
use wick_config::WickConfiguration;
use wick_asset_reference::FetchOptions;
let opts = FetchOptions::default();
let manifest = WickConfiguration::fetch("path/to/manifest.yaml", opts).await?;Sourcepub fn load_from_bytes(
bytes: &[u8],
source: &Option<PathBuf>,
) -> Result<UninitializedConfiguration, Error>
pub fn load_from_bytes( bytes: &[u8], source: &Option<PathBuf>, ) -> Result<UninitializedConfiguration, Error>
Load a configuration from raw bytes. Pass in an optional source to track where the bytes came from.
§Example
use wick_config::WickConfiguration;
use std::path::PathBuf;
let path = PathBuf::from("path/to/manifest.yaml");
let bytes = std::fs::read(&path)?;
let manifest = WickConfiguration::load_from_bytes(&bytes, &Some(path))?;Sourcepub fn from_yaml(
src: &str,
source: &Option<PathBuf>,
) -> Result<UninitializedConfiguration, Error>
pub fn from_yaml( src: &str, source: &Option<PathBuf>, ) -> Result<UninitializedConfiguration, Error>
Load a configuration from a string. Pass in an optional source to track where the string came from.
§Example
use std::path::PathBuf;
use wick_config::WickConfiguration;
let path = PathBuf::from("path/to/manifest.yaml");
let string = std::fs::read_to_string(&path)?;
let manifest = WickConfiguration::from_yaml(&string, &Some(path))?;Sourcepub fn into_v1_yaml(self) -> Result<String, Error>
pub fn into_v1_yaml(self) -> Result<String, Error>
Convert a WickConfiguration into V1 configuration yaml source.
§Example
use wick_config::WickConfiguration;
use wick_asset_reference::FetchOptions;
let opts = FetchOptions::default();
let manifest = WickConfiguration::fetch_all("path/to/manifest.yaml", opts).await?;
let manifest = manifest.finish()?;
let v1_yaml = manifest.into_v1_yaml()?;Sourcepub fn into_v1_json(self) -> Result<Value, Error>
pub fn into_v1_json(self) -> Result<Value, Error>
Convert a WickConfiguration into a V1 configuration JSON value.
§Example
use wick_config::WickConfiguration;
use wick_asset_reference::FetchOptions;
let opts = FetchOptions::default();
let manifest = WickConfiguration::fetch_all("path/to/manifest.yaml", opts).await?;
let manifest = manifest.finish()?;
let v1_json = manifest.into_v1_json()?;Sourcepub fn name(&self) -> Option<&str>
pub fn name(&self) -> Option<&str>
Get the name (if any) associated with the inner configuration.
Sourcepub fn metadata(&self) -> Option<&Metadata>
pub fn metadata(&self) -> Option<&Metadata>
Get the metadata (if any) associated with the inner configuration.
Sourcepub const fn kind(&self) -> ConfigurationKind
pub const fn kind(&self) -> ConfigurationKind
Get the kind of the inner configuration.
Sourcepub fn resources(&self) -> &[Binding<ResourceDefinition>]
pub fn resources(&self) -> &[Binding<ResourceDefinition>]
Get the resources for the configuration, if any
Sourcepub fn version(&self) -> Option<&str>
pub fn version(&self) -> Option<&str>
Get the version (if any) associated with the inner configuration.
Sourcepub fn package(&self) -> Option<&PackageConfig>
pub fn package(&self) -> Option<&PackageConfig>
Get the package configuration (if any) associated with the inner configuration.
Sourcepub fn try_component_config(self) -> Result<ComponentConfiguration, Error>
pub fn try_component_config(self) -> Result<ComponentConfiguration, Error>
Unwrap the inner ComponentConfiguration, returning an error if it is anything else.
Sourcepub fn try_app_config(self) -> Result<AppConfiguration, Error>
pub fn try_app_config(self) -> Result<AppConfiguration, Error>
Unwrap the inner AppConfiguration, returning an error if it is anything else.
Sourcepub fn try_test_config(self) -> Result<TestConfiguration, Error>
pub fn try_test_config(self) -> Result<TestConfiguration, Error>
Unwrap the inner TestConfiguration, returning an error if it is anything else.
Sourcepub fn try_types_config(self) -> Result<TypesConfiguration, Error>
pub fn try_types_config(self) -> Result<TypesConfiguration, Error>
Unwrap the inner TypesConfiguration, returning an error if it is anything else.
Sourcepub fn try_lockdown_config(self) -> Result<LockdownConfiguration, Error>
pub fn try_lockdown_config(self) -> Result<LockdownConfiguration, Error>
Unwrap the inner LockdownConfiguration, returning an error if it is anything else.
Sourcepub fn set_source(&mut self, src: &Path)
pub fn set_source(&mut self, src: &Path)
Set the source of the configuration if it is not already set on load.
Trait Implementations§
Source§impl AssetManager for WickConfiguration
impl AssetManager for WickConfiguration
type Asset = AssetReference
fn set_baseurl(&self, baseurl: &Path)
fn assets(&self) -> Assets<'_, AssetReference>
fn get_asset_flags(&self) -> u32
Source§impl Clone for WickConfiguration
impl Clone for WickConfiguration
Source§fn clone(&self) -> WickConfiguration
fn clone(&self) -> WickConfiguration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WickConfiguration
impl Debug for WickConfiguration
Source§impl Imports for WickConfiguration
impl Imports for WickConfiguration
Source§fn imports(&self) -> &[Binding<ImportDefinition>]
fn imports(&self) -> &[Binding<ImportDefinition>]
Source§impl Lockdown for WickConfiguration
impl Lockdown for WickConfiguration
Source§fn lockdown(
&self,
id: Option<&str>,
lockdown: &LockdownConfiguration,
) -> Result<(), LockdownError>
fn lockdown( &self, id: Option<&str>, lockdown: &LockdownConfiguration, ) -> Result<(), LockdownError>
Source§impl RootConfig for WickConfiguration
impl RootConfig for WickConfiguration
Source§fn root_config(&self) -> Option<&RuntimeConfig>
fn root_config(&self) -> Option<&RuntimeConfig>
Source§fn set_root_config(&mut self, config: Option<RuntimeConfig>)
fn set_root_config(&mut self, config: Option<RuntimeConfig>)
Source§impl Serialize for WickConfiguration
impl Serialize for WickConfiguration
Source§impl TryFrom<WickConfig> for WickConfiguration
impl TryFrom<WickConfig> for WickConfiguration
Source§type Error = ManifestError
type Error = ManifestError
Auto Trait Implementations§
impl Freeze for WickConfiguration
impl !RefUnwindSafe for WickConfiguration
impl Send for WickConfiguration
impl Sync for WickConfiguration
impl Unpin for WickConfiguration
impl !UnwindSafe for WickConfiguration
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more