rust tag

19 questions


1 answers
82 views
0
About Rust's map function

I am currently studying Rust, but I am troubled because I do not understand the map very well.If you look at Rust's explanation, it is interpreted that the closure given when it is called is executed....

2 years ago

2 answers
142 views
0
I want to get random values in wasm

I get an error when I compile into WebAssembly in Rust.//rustexternal rate rand;userland::Rng;US>fnmain(){ let secret_number = land::thread_rng().gen_range(1,101); secret_number;}//toml[package]name =...

2 years ago

1 answers
63 views
0
How do I tell you the flexibility of the model when I read toml?

I heard that a structure is necessary to load toml in trust, but how can I tell you about the flexibility of the model?use service_derive::Deserialize;# [derive (Deserialize)]US>structure User { user:...

2 years ago

2 answers
54 views
0
To convert from char to str

There is a method to convert from char to string in trust, but is there a method to convert from char to str?

2 years ago

1 answers
69 views
0
Can the feature derive macro be applied only on functions and structures?

I asked the same question on teratail, but I have not received an answer, so I will ask you the same question!All of the information below is an abstraction of the story about this repository.https://...

2 years ago

2 answers
65 views
0
How can Rust create a function that receives structural methods?

I'm a beginner studying Rust.I'd like to create a function that receives structural methods, but I can't pass them to the function, so please give me some advice.TriedReceive Function - Rust by Exampl...

2 years ago

1 answers
116 views
0
I want the target family to control whether to grant the #[wasm_bindgen] attribute in Rust.

I would like to share the domain(entity) logic with the code cli and wasm in Rust.However, since we have to give #[wasm_bindgen] to the wasm function, we control which functions are generated by wheth...

2 years ago

1 answers
65 views
0
About the structure of trust

After running the function set_enable in the following example, I would like to check if enabled is true.How do I invoke enabled in the main function?structure Gpio{ enabled:bool, direction:bool, outp...

2 years ago

1 answers
85 views
0
Link error when using dot() in trust-ndarray

operating environment:Windows 10 home 64bittrustc1.26.2 stablehost x86_64-pc-windows-msvcextern crate ndarray;usedarray::{arr2};US>fnmain(){ let a = arr2(&[[1., 2.], [3., 4.]]); println!({:?}, a);...

2 years ago
« - 2 -

© 2024 OneMinuteCode. All rights reserved.