We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Take this test for example:
#[carol] impl Foo { #[activate] pub fn add(&self, lhs: u32, rhs: u32) -> u32 { lhs + rhs } #[activate] pub fn checked_sub(&self, lhs: u32, rhs: u32) -> Option<u32> { lhs.checked_sub(rhs) } pub fn non_activate(&self) { unreachable!() } } use carol_activate::{Activate, Add, CheckedSub}; #[test] fn call_add() { let method = Activate::Add(Add { lhs: 7, rhs: 3 }); let call = bincode::encode_to_vec(method, bincode::config::standard()).unwrap(); let foo = Foo; let output = Foo::activate( bincode::encode_to_vec(foo, bincode::config::standard()).unwrap(), call, ); let (result, _): (u32, _) = bincode::decode_from_slice(&output, bincode::config::standard()).unwrap(); assert_eq!(result, 10); }
In that test I think I should be able to just do:
let foo = Foo; let (input, decoder) = input_gen::add(7, 3); let output = Foo::activate( bincode::encode_to_vec(foo, bincode::config::standard()).unwrap(), call, ); let output = decoder.decode(output)?; assert_eq!(output, 10);
where input_gen is codegen'd by the macro.
input_gen
This is useful so you can easily activate from client code without having to construct enum variants manually.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Take this test for example:
In that test I think I should be able to just do:
where
input_gen
is codegen'd by the macro.This is useful so you can easily activate from client code without having to construct enum variants manually.
The text was updated successfully, but these errors were encountered: