Skip to content

Commit

Permalink
Rename wasm-wrapper to wasm-bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
mrozycki committed Dec 1, 2024
1 parent f28e0c6 commit 835ad9e
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ members = [
"animation-template-native",
"animation-template-wasm",
"animation-utils",
"animation-wasm-wrapper",
"animation-wasm-bindings",
"animations",
"light-client",
"configurator",
Expand Down
4 changes: 2 additions & 2 deletions animation-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ fn generate_wasm_plugin(ast: syn::ItemStruct) -> proc_macro2::TokenStream {
quote! {
#ast

type WrappedGuestPlugin = animation_wasm_wrapper::guest::GuestPluginWrapper<#name>;
animation_wasm_wrapper::guest::export!(WrappedGuestPlugin with_types_in animation_wasm_wrapper::guest);
type WrappedGuestPlugin = animation_wasm_bindings::guest::GuestPluginBindings<#name>;
animation_wasm_bindings::guest::export!(WrappedGuestPlugin with_types_in animation_wasm_bindings::guest);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "animation-wasm-wrapper"
name = "animation-wasm-bindings"
version = "0.1.0"
edition = "2021"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ wit_bindgen::generate!({
pub_export_macro: true,
});

pub struct GuestPluginWrapper<T: animation_api::Animation> {
pub struct GuestPluginBindings<T: animation_api::Animation> {
_phantom: PhantomData<T>,
}

impl<T: animation_api::Animation + 'static> Guest for GuestPluginWrapper<T> {
type Animation = GuestAnimationWrapper<<T as animation_api::Animation>::Wrapped>;
impl<T: animation_api::Animation + 'static> Guest for GuestPluginBindings<T> {
type Animation = GuestAnimationBindings<<T as animation_api::Animation>::Wrapped>;
}

pub struct GuestAnimationWrapper<T: animation_api::Animation<Parameters: GetSchema>> {
pub struct GuestAnimationBindings<T: animation_api::Animation<Parameters: GetSchema>> {
inner: RefCell<T>,
}

impl<T: animation_api::Animation + 'static> exports::guest::animation::plugin::GuestAnimation
for GuestAnimationWrapper<T>
for GuestAnimationBindings<T>
{
fn new(points: Vec<Position>) -> Self {
Self {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions animator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ thiserror = "1.0.60"
itertools = "0.13.0"
async-trait = "0.1.83"

[dependencies.animation-wasm-wrapper]
path = "../animation-wasm-wrapper"
[dependencies.animation-wasm-bindings]
path = "../animation-wasm-bindings"
default-features = false
features = ["host"]

Expand Down
2 changes: 1 addition & 1 deletion animator/src/wasm.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::HashMap;

use animation_api::{event::Event, schema};
use animation_wasm_wrapper::host::HostedPlugin;
use animation_wasm_bindings::host::HostedPlugin;
use async_trait::async_trait;
use tokio::sync::Mutex;

Expand Down
4 changes: 2 additions & 2 deletions test-wasm-animation/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ itertools = "0.10.5"
serde = "1.0.215"
serde_json = "1.0.133"

[dependencies.animation-wasm-wrapper]
path = "../animation-wasm-wrapper"
[dependencies.animation-wasm-bindings]
path = "../animation-wasm-bindings"
default-features = false
features = ["guest"]

0 comments on commit 835ad9e

Please sign in to comment.