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 registry: RegistryConfig,
pub dev: DevConfig,
pub package_config: Option<Config>,
}
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: String
The language of the project, e.g. rust, tinygo. This is used to determine which config to parse.
project_type: String
The 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: i32
Monotonically 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: ComponentConfig
Configuration relevant to components
provider: ProviderConfig
Configuration relevant to providers
rust: RustConfig
Rust configuration and options
tinygo: TinyGoConfig
TinyGo related configuration and options
go: GoConfig
Golang related configuration and options
registry: RegistryConfig
Configuration for image registry usage
dev: DevConfig
Configuration 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
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