<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in mod.rs</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>9f47be2e - Support store-access in `bindgen!` generated imports  (#11628)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs#9f47be2e</link>
        <description>Support store-access in `bindgen!` generated imports  (#11628)* Support store-access in `bindgen!` generated importsThis commit adds support to accessing the store in `bindgen!`-generatedimport functions in traits. Since the inception of `bindgen!` this hasnever been possible and access to the store requires manually workingwith `Linker`, for example. This is not easy to do because it requiressurgically editing code or working around what bindings generation partsyou do want.The implementation here is a small step away from whatcomponent-model-async has already implemented for async functions.Effectively it&apos;s a small extension of the `*WithStore` traits to alsohave synchronous functions with `Access` parameters instead of `async`functions with an `Accessor` parameter.This is something we&apos;re going to want for the WASIp3 implementationwhere I&apos;ve noticed some resource destructors are going to want access tothe store to close out streams and such and this&apos;ll provide the bindingsnecessary for that.Closes #11590* Update test expectations

            List of files:
            /wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs</description>
        <pubDate>Fri, 05 Sep 2025 21:28:49 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>838ed2d0 - Enable `allow_attributes_without_reason` (#11195)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs#838ed2d0</link>
        <description>Enable `allow_attributes_without_reason` (#11195)* Enable `allow_attributes_without_reason`This commit enables the `clippy::allow_attributes_without_reason` forthe `wasmtime` crate which previously forcibly allowed it. The reasonthis was allowed was that when the workspace was first migrated theWasmtime crate had too many instances that I was willing to fix. I&apos;venow come back around and tried to fix everything.In short: ideally delete `#[allow]`, otherwise use `#[expect]`,otherwise use `#[allow]`.prtest:full* Adjust some directives* Fix some warnings* Fix stack switching size tests on unix* Don&apos;t have a conditional `Drop` impl* Force `testing_freelist` method to be usedToo lazy to write `#[cfg]`, but not too lazy to write a test.

            List of files:
            /wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs</description>
        <pubDate>Mon, 07 Jul 2025 21:52:03 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>f6775a33 - Replace `GetHost` with a function pointer, add `HasData` (#10770)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs#f6775a33</link>
        <description>Replace `GetHost` with a function pointer, add `HasData` (#10770)* Replace `GetHost` with a function pointer, add `HasData`This commit is a refactoring to the fundamentals of the `bindgen!` macroand the functions that it generates. Prior to this change thefundamental entrypoint generated by `bindgen!` was a function`add_to_linker_get_host` which takes a value of type `G: GetHost`. This`GetHost` implementation is effectively an alias for a closure whosereturn value is able to close over the parameter given lfietime-wise.The `GetHost` abstraction was added to Wasmtime originally to enableusing any type that implements `Host` traits, not just `&amp;mut U` as wasoriginally supported. The definition of `GetHost` was _just_ right toenable a type such as `MyThing&lt;&amp;mut T&gt;` to implement `Host` and aclosure could be provided that could return it. At the time that`GetHost` was added it was known to be problematic from anunderstandability point of view, namely:* It has a non-obvious definition.* It&apos;s pretty advanced Rust voodoo to understand what it&apos;s actually  doing* Using `GetHost` required lots of `for&lt;&apos;a&gt; ...` in places which is  unfamiliar syntax for many.* `GetHost` values couldn&apos;t be type-erased (e.g. put in a trait object)  as we couldn&apos;t figure out the lifetime syntax to do so.Despite these issues it was the only known solution at hand so we landedit and kept the previous `add_to_linker` style (`&amp;mut T -&gt; &amp;mut U`) as aconvenience. While this has worked reasonable well (most folks just tryto not look at `GetHost`) it has reached a breaking point in the WASIp3work.In the WASIp3 work it&apos;s effectively now going to be required that the`G: GetHost` value is packaged up and actually stored inside ofaccessors provided to host functions. This means that `GetHost` valuesnow need to not only be taken in `add_to_linker` but additionallyprovided to the rest of the system through an &quot;accessor&quot;. This was madepossible in #10746 by moving the `GetHost` type into Wasmtime itself (asopposed to generated code where it lived prior).While this worked with WASIp3 and it was possible to plumb `G: GetHost`safely around, this ended up surfacing more issues. Namely all&quot;concurrent&quot; host functions started getting significantly morecomplicated `where` clauses and type signatures. At the end of the day Ifelt that we had reached the end of the road to `GetHost` and wanted tosearch for alternatives, hence this change.The fundamental purpose of `GetHost` was to be able to express, in ageneric fashion:* Give me a closure that takes `&amp;mut T` and returns `D`.* The `D` type can close over the lifetime in `&amp;mut T`.* The `D` type must implement `bindgen!`-generated traits.A realization I had was that we could model this with a genericassociated type in Rust. Rust support for generic associated types isrelatively new and not something I&apos;ve used much before, but it ended upbeing a perfect model for this. The definition of the new `HasData`trait is deceptively simple:    trait HasData {        type Data&lt;&apos;a&gt;;    }What this enables us to do though is to generate `add_to_linker`functions that look like this:    fn add_to_linker&lt;T, D&gt;(        linker: &amp;mut Linker&lt;T&gt;,        getter: fn(&amp;mut T) -&gt; D::Data&lt;&apos;_&gt;,    ) -&gt; Result&lt;()&gt;      where        D: HasData,        for&lt;&apos;a&gt; D::Data&lt;&apos;a&gt;: Host;This definition here models `G: GetHost` as a literal function pointer,and the ability to close over the `&amp;mut T` lifetime with type (not just`&amp;mut U`) is expressed through the type constructor `type Data&lt;&apos;a&gt;`).Ideally we could take a generic generic associated type (I&apos;m not evensure what to call that), but that&apos;s not something Rust has today.Overall this felt like a much simpler way of modeling `GetHost` and itsrequirements. This plumbed well throughout the WASIp3 work and thesignatures for concurrent functions felt much more appropriate in termsof complexity after this change. Taking this change to the limit meansthat `GetHost` in its entirety could be purged since all usages of itcould be replaced with `fn(&amp;mut T) -&gt; D::Data&lt;&apos;a&gt;`, a hopefully muchmore understandable type.This change is not all rainbows however, there are some gotchas thatremain:* One is that all `add_to_linker` generated functions have a `D:  HasData` type parameter. This type parameter cannot be inferred and  must always be explicitly specified, and it&apos;s not easy to know what to  supply here without reading documentation. Actually supplying the type  parameter is quite easy once you know what to do (and what to fill  in), but it may involve defining a small struct with a custom  `HasData` implementation which can be non-obvious.* Another is that the `G: GetHost` value was previously a full Rust  closure, but now it&apos;s transitioning to a function pointer. This is  done in preparation for WASIp3 work where the function needs to be  passed around, and doing that behind a generic parameter is more  effort than it&apos;s worth. This means that embedders relying on the true  closure-like nature here will have to update to using a function  pointer instead.* The function pointer is stored in locations that require `&apos;static`,  and while `fn(T)` might be expected to be `&apos;static` regardless of `T`  is is, in fact, not. This means that practically `add_to_linker`  requires `T: &apos;static`. Relative to just before this change this is a  possible regression in functionality, but there orthogonal reasons  beyond just this that we want to start requiring `T: &apos;static` anyway.  That means that this isn&apos;t actually a regression relative to #10760, a  related change.The first point is partially ameliorated with WASIp3 work insofar thatthe `D` type parameter will start serving as a location to specify whereconcurrent implementations are found. These concurrent methods don&apos;ttake `&amp;mut self` but instead are implemented for `T: HasData` types. Inthat sense it&apos;s more justified to have this weird type parameter, but inthe meantime without this support it&apos;ll feel a bit odd to have thislittle type parameter hanging off the side.This change has been integrated into the WASIp3 prototyping repositorywith success. This has additionally been integrated into the Spinembedding which has one of the more complicated reliances on`*_get_host` functions known. Given that it&apos;s expected that while thisis not necessarily a trivial change to rebase over it should at least bepossible.Finally the `HasData` trait here has been included with what I&apos;m hopingis a sufficient amount of documentation to at least give folks a springboard to understand it. If folks have confusion about this `D` typeparameter my hope is they&apos;ll make their way to `HasData` which showcasesvarious patterns for &quot;librarifying&quot; host implementations of WITinterfaces. These patterns are all used throughout Wasmtime and WASIcurrently in crates and tests and such.* Update expanded test expectations

            List of files:
            /wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs</description>
        <pubDate>Tue, 13 May 2025 05:47:01 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>9547f2fe - Update mod.rs (#10492)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs#9547f2fe</link>
        <description>Update mod.rs (#10492)

            List of files:
            /wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs</description>
        <pubDate>Mon, 31 Mar 2025 17:19:42 +0000</pubDate>
        <dc:creator>Hopium &lt;135053852+Hopium21@users.noreply.github.com&gt;</dc:creator>
    </item>
<item>
        <title>9e46e78a - Fix some more minor 2024 edition things (#9978)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs#9e46e78a</link>
        <description>Fix some more minor 2024 edition things (#9978)* Fix some doctests to be compatible with the 2024 edition.* Fix a `use&lt;...&gt;` that&apos;s an error in the 2024 edition but works in the  2021 edition.

            List of files:
            /wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs</description>
        <pubDate>Fri, 10 Jan 2025 17:45:51 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>afd8bb39 - Add async example to bindgen_examples (#9822)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs#afd8bb39</link>
        <description>Add async example to bindgen_examples (#9822)* add async example* fix bindgen bug to make CI happySee https://github.com/bytecodealliance/wasmtime/pull/9822#issuecomment-2546851949* update test expectations* remove async_trait

            List of files:
            /wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs</description>
        <pubDate>Fri, 20 Dec 2024 19:34:10 +0000</pubDate>
        <dc:creator>ifsheldon &lt;39153080+ifsheldon@users.noreply.github.com&gt;</dc:creator>
    </item>
<item>
        <title>3171ef6d - Redesign how component exports work (#8786)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs#3171ef6d</link>
        <description>Redesign how component exports work (#8786)* Un-nest exports in a componentThis commit flattens the representation of exports in a component tomake them more easily indexable without forcing traversal through thehierarchy of instance imports/exports to get there.* Guarantee type information on component exportsDon&apos;t have it optional in some cases and present in others, insteadensure there&apos;s type information for all component exports immediatelyavailable.* Refactor how component instance exports are loadedThis commit is a change to Wasmtime&apos;s public API for`wasmtime::component::Instance` that reorganizes how component exportsare loaded. Previously there was a system where `Instance::exports()`was called that that was sort of &quot;iterated over&quot; in a builder-stylepattern to acquire the actual export desired. This required lifetimetrickery for nested instances and some unfortunate API bloat. The majordownside of this approach is that it requires unconditional stringlookups at runtime for exports and additionally does not serve as agreat place to implement the semver-compatible logic of #8395. The goalof this refactoring is to pave the way to improving this.The new APIs for loading exports now look a bit more similar to what&apos;savailable for core modules. Notably there&apos;s a new`Component::export_index` method which enables performing a stringlookup and returning an index. This index can in turn be passed to`Instance::get_*` to skip the string lookup when exports are loaded. The`Instance::exports` API is then entirely removed and dismantled.The only piece remaining is the ability to load nested exports which isdone through an `Option` parameter to `Component::export_index`. Theway to load a nested instance is now to first lookup the instance with`None` as this parameter an then the instance itself is `Some` to lookup an export of that instance. This removes the need for arecursive-style lifetime-juggling API from wasmtime and in theory helpssimplify the usage of loading exports.* Update `bindgen!` generated structures for exportsThis commit updates the output of `bindgen!` to have a different setupfor exports of worlds to handle the changes from the previous commit.This introduces new `*Pre` structures which are generated alongside theexisting `Guest` structures for example. The `*Pre` versions contain`ComponentExportIndex` from the previous commit and serve as a path toaccelerating instantiation because all name lookups are skipped.* Update test expectations for `bindgen!`-generated output* Review comments* Fix doc link

            List of files:
            /wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs</description>
        <pubDate>Tue, 18 Jun 2024 01:05:39 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>bdd78422 - Wasmtime: Implement the custom-page-sizes proposal (#8763)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs#bdd78422</link>
        <description>Wasmtime: Implement the custom-page-sizes proposal (#8763)* Wasmtime: Implement the custom-page-sizes proposalThis commit adds support for the custom-page-sizes proposal to Wasmtime:https://github.com/WebAssembly/custom-page-sizesI&apos;ve migrated, fixed some bugs within, and extended the `*.wast` tests for thisproposal from the `wasm-tools` repository. I intend to upstream them into theproposal shortly.There is a new `wasmtime::Config::wasm_custom_page_sizes_proposal` method toenable or disable the proposal. It is disabled by default.Our fuzzing config has been updated to turn this feature on/off as dictated bythe arbitrary input given to us from the fuzzer.Additionally, there were getting to be so many constructors for`wasmtime::MemoryType` that I added a builder rather than add yet anotherconstructor.In general, we store the `log2(page_size)` rather than the page sizedirectly. This helps cut down on invalid states and properties we need toassert.I&apos;ve also intentionally written this code such that supporting any power of twopage size (rather than just the exact values `1` and `65536` that are currentlyvalid) will essentially just involve updating `wasmparser`&apos;s validation andremoving some debug asserts in Wasmtime.* Update error string expectation* Remove debug logging* Use a right shift instead of a division* fix error message expectation again* remove page size from VMMemoryDefinition* fix size of VMMemoryDefinition again* Only dynamically check for `-1` sentinel for 1-byte page sizes* Import functions that are used a few times* Better handle overflows when rounding up to the host page sizePropagate errors instead of returning a value that is not actually a rounded upversion of the input.Delay rounding up various config sizes until runtime instead of eagerly doing itat config time (which isn&apos;t even guaranteed to work, so we already had to have abackup plan to round up at runtime, since we might be cross-compiling wasm ornot have the runtime feature enabled).* Fix some anyhow and nostd errors* Add missing rounding up to host page size at runtime* Add validate feature to wasmparser dep* Add some new rounding in a few places, due to no longer rounding in config methods* Avoid actually trying to allocate the whole address space in the `massive_64_bit_still_limited` testThe point of the test is to ensure that we hit the limiter, so just cancel theallocation from the limiter, and otherwise avoid MIRI attempting to allocate abunch of memory after we hit the limiter.* prtest:full* Revert &quot;Avoid actually trying to allocate the whole address space in the `massive_64_bit_still_limited` test&quot;This reverts commit ccfa34a78dd3d53e49a6158ca03077d42ce8bcd7.* miri: don&apos;t attempt to allocate more than 4GiB of memoryIt seems that rather than returning a null pointer from `std::alloc::alloc`,miri will sometimes choose to simply crash the whole program.* remove duplicate prelude import after rebasing

            List of files:
            /wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs</description>
        <pubDate>Wed, 12 Jun 2024 21:46:42 +0000</pubDate>
        <dc:creator>Nick Fitzgerald &lt;fitzgen@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>44220746 - Overhaul and improve documentation of `bindgen!` (#8727)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs#44220746</link>
        <description>Overhaul and improve documentation of `bindgen!` (#8727)This is another take at improving the documentation for `bindgen!` inWasmtime. This commit takes a leaf out of the book ofbytecodealliance/wit-bindgen#871 to organize the documentation of themacro a bit more rather than having one giant doc block that can bedifficult to explore. The macro&apos;s documentation itself is now mostly areference of all the options that can be specified. There is now a newdocumentation-only module which serves a few purposes:* Individual examples are organized per-submodule to be a bit more  digestable.* Each example has an example of the generated code in addition to the  source code used for each example.* All examples are tested on CI to compile (none are run).My hope is that this makes it easier to expand the docs here furtherover time with niche features as they arise or with various options thatthe macro has. This is one of the lynchpins of Wasmtime&apos;s support forthe component model so it seems pretty important to have a goodonboarding experience here.Along the way I&apos;ve implemented a few more niche options for the`bindgen!` macro that I found necessary, such as configuring the`wasmtime` crate and where it&apos;s located.

            List of files:
            /wasmtime-44.0.1/crates/wasmtime/src/runtime/component/bindgen_examples/mod.rs</description>
        <pubDate>Mon, 03 Jun 2024 13:50:05 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
</channel>
</rss>
