-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
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
Native usage library #267
Comments
You can use it directly from rust as well. The documentation was written more for web users as those comprise most of the people using the library but it's totally possible to use it from rust. Some of the APIs are a bit clunky from rust due to having to conform to wasm-bindgen though. We have a crate on cargo: https://crates.io/crates/cardano-serialization-lib/ |
I wonder how it's will look like on native target to deal with edit: I see that JsError is a string on native platform - all good. I still think that few example in pure Rust would have been nice |
Yeah, as you saw I guess with your edit we have #[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))]
pub type JsError = JsValue;
#[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))]
#[derive(Debug, Clone)]
pub struct JsError {
msg: String,
} which isn't ideal but it at least won't panic in rust builds like The JS examples should work almost the same you'll just need to replace things like |
Thanks for all those precious explanation, I may have some more questions later, is there any discord or telegram for dev? |
|
I joined the following I understand that the scope of |
I'm going to link to #276 here so that people inquiring about rust native usage can help tell us what they would like to see potentially. |
Hello, I was curious if this library could be used in a native rust target that is not wasm or web.
For example to add light wallet functionality to a native rust target (amd64)
I was looking to potentially add Cardano support to https://github.com/KomodoPlatform/atomicDEX-API
The project is written in rust and supports all existing platforms: amd64, arm & wasm. But if I take a good look at this project, I feel like I can only use the wasm version currently, the documentation is not very clear on this.
The text was updated successfully, but these errors were encountered: