-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
2,016 additions
and
1,057 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
32 changes: 32 additions & 0 deletions
32
lib/bindings/langs/react-native/src/gen_kotlin/callback_interface.rs
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,32 @@ | ||
/* 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 uniffi_bindgen::ComponentInterface; | ||
|
||
use super::CodeType; | ||
|
||
#[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::KotlinCodeOracle.class_name(ci, &self.id) | ||
} | ||
|
||
fn canonical_name(&self) -> String { | ||
format!("Type{}", self.id) | ||
} | ||
|
||
fn initialization_fn(&self) -> Option<String> { | ||
Some(format!("{}.register", self.ffi_converter_name())) | ||
} | ||
} |
Oops, something went wrong.