-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* First pass at async file, still need futures * Futures test passed! I don't believe it... need some more complex tests * Update src/templates/UniffiHandleMap.java Co-authored-by: Bob Wall <[email protected]> * Update src/templates/UniffiHandleMap.java Co-authored-by: Bob Wall <[email protected]> * Checkpointing to update another branch * Going to require implementing callbacks anyway * So close to working async_traits Right now `CallbackTemplate.java` isn't being included in the generation, causing all build failures * One compilation error away... from probably the next batch of compilation errors! * Compiles, runtime error and need to fill out tests * Structures don't allow boxed type class fields need to make everything primitives if possible. If not, need to make primitives around structures. * Appropriate documentation is important. Structures require a no-args constructor in almost all cases. The Kotlin one happened to be working because all args were defaultable, which from the Java view works as a no-args constructor. Nothing about this is mentioned in the Structure or JNA documentation. * Sooooooo close. Something going on with cancellation looks like it's the cause of the only remaining failures (commented out). * Only cancellation failing Async callbacks weren't waiting on `get` correctly. Once that was fixed needed to unwrap `ExecutionException`s so they could be passed to Rust callbacks correctly. * Normal future cancellation fixed. * Fixed trait future cancellation too * Clean up some TODOs after PR comment pass * What if CI just needs more time? * Add a little more info to assert fail * Only run the failing test * Touch to rebuild * Add all tests back in * Bytes type and coverall test fixture (#16) * Passing tests, coverall generation working Still need to complete coverall tests * Checkpointing because I don't want to lose it * Finished all coverall tests * rogue println --------- Co-authored-by: Bob Wall <[email protected]> Co-authored-by: Colt Frederickson <[email protected]>
- Loading branch information
1 parent
dc8113f
commit 61e2d40
Showing
31 changed files
with
3,381 additions
and
271 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
use super::CodeType; | ||
use crate::ComponentInterface; | ||
|
||
#[derive(Debug)] | ||
pub struct CallbackInterfaceCodeType { | ||
id: String, | ||
} | ||
|
||
impl CallbackInterfaceCodeType { | ||
pub fn new(id: String) -> Self { | ||
Self { id } | ||
} | ||
} | ||
|
||
impl CodeType for CallbackInterfaceCodeType { | ||
fn type_label(&self, ci: &ComponentInterface) -> String { | ||
super::JavaCodeOracle.class_name(ci, &self.id) | ||
} | ||
|
||
fn canonical_name(&self) -> String { | ||
format!("Type{}", self.id) | ||
} | ||
|
||
fn initialization_fn(&self) -> Option<String> { | ||
Some(format!( | ||
"UniffiCallbackInterface{}.INSTANCE.register", | ||
self.id | ||
)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.