-
Notifications
You must be signed in to change notification settings - Fork 260
Open
Labels
gen-rustRelated to bindings for Rust-compiled-to-WebAssemblyRelated to bindings for Rust-compiled-to-WebAssembly
Description
In the rust guest implementaiton, it would be interesting to explore the idea of having the function return a reference to self if there isn't a return value. This would enable chaining like the following.
interface text {
resource text-component {
text: static func(plain: string) -> text-component;
add-text: func(text: string);
underlined: func(value: bool);
}
}fn main() {
let text = TextComponent::text("My Component").underlined(true).add_text(" - my additional text here");
}This could also be put under a feature flag in wit-bindgen.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
gen-rustRelated to bindings for Rust-compiled-to-WebAssemblyRelated to bindings for Rust-compiled-to-WebAssembly