pub struct WasmcloudDotToml {Show 16 fields
pub language: String,
pub project_type: String,
pub name: Option<String>,
pub version: Option<Version>,
pub revision: i32,
pub path: Option<PathBuf>,
pub wit: Option<PathBuf>,
pub build: Option<PathBuf>,
pub component: ComponentConfig,
pub provider: ProviderConfig,
pub rust: RustConfig,
pub tinygo: TinyGoConfig,
pub go: GoConfig,
pub dev: DevConfig,
pub package_config: Option<Config>,
pub registry: RegistryConfig,
}Expand description
The wasmcloud.toml specification format as de-serialization friendly project configuration data
This structure is normally directly de-serialized from wasmcloud.toml,
and is used to build a more structured ProjectConfig object.
Below is an example of each option in the wasmcloud.toml file. A real example only needs to include the fields that are relevant to the project.
use wash_lib::parser::WasmcloudDotToml;
let component_toml = r#"
language = "rust"
type = "component"
name = "testcomponent"
version = "0.1.0"
"#;
let config: WasmcloudDotToml = toml::from_str(component_toml).expect("should deserialize");
eprintln!("{config:?}");Fields§
§language: StringThe language of the project, e.g. rust, tinygo. This is used to determine which config to parse.
project_type: StringThe type of project. This is a string that is used to determine which type of config to parse. The toml file name is just “type” but is named project_type here to avoid clashing with the type keyword in Rust.
name: Option<String>Name of the project. Optional if building a Rust project, as it can be inferred from Cargo.toml.
version: Option<Version>Semantic version of the project. Optional if building a Rust project, as it can be inferred from Cargo.toml.
revision: i32Monotonically increasing revision number.
path: Option<PathBuf>Path to the directory where the project is located. Defaults to the current directory. This path is where build commands will be run.
wit: Option<PathBuf>Path to the directory where the WIT world and dependencies can be found. Defaults to a wit
directory in the project root.
build: Option<PathBuf>Path to the directory where the built artifacts should be written. Defaults to a build
directory in the project root.
component: ComponentConfigConfiguration relevant to components
provider: ProviderConfigConfiguration relevant to providers
rust: RustConfigRust configuration and options
tinygo: TinyGoConfigTinyGo related configuration and options
go: GoConfigGolang related configuration and options
dev: DevConfigConfiguration for development environments and/or DX related plugins
package_config: Option<Config>Overrides for interface dependencies.
This is often used to point to local wit files
registry: RegistryConfigConfiguration for image registry usage
Implementations§
Source§impl WasmcloudDotToml
impl WasmcloudDotToml
pub fn convert(self, wasmcloud_toml_dir: PathBuf) -> Result<ProjectConfig>
Trait Implementations§
Source§impl Debug for WasmcloudDotToml
impl Debug for WasmcloudDotToml
Source§impl<'de> Deserialize<'de> for WasmcloudDotToml
impl<'de> Deserialize<'de> for WasmcloudDotToml
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>,
Auto Trait Implementations§
impl Freeze for WasmcloudDotToml
impl RefUnwindSafe for WasmcloudDotToml
impl Send for WasmcloudDotToml
impl Sync for WasmcloudDotToml
impl Unpin for WasmcloudDotToml
impl UnwindSafe for WasmcloudDotToml
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> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read moreSource§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