wash_lib::parser

Struct WasmcloudDotToml

source
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

source

pub fn convert(self, wasmcloud_toml_dir: PathBuf) -> Result<ProjectConfig>

Trait Implementations§

source§

impl Debug for WasmcloudDotToml

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for WasmcloudDotToml

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromBase64 for T
where T: for<'de> Deserialize<'de>,

source§

fn from_base64<Input>(raw: &Input) -> Result<T, Error>
where Input: AsRef<[u8]> + ?Sized,

source§

impl<T> FutureExt for T

source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
source§

impl<T> GetSetFdFlags for T

source§

fn get_fd_flags(&self) -> Result<FdFlags, Error>
where T: AsFilelike,

Query the “status” flags for the self file descriptor.
source§

fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>
where T: AsFilelike,

Create a new SetFdFlags value for use with set_fd_flags. Read more
source§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>
where T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,