{ "@context": "https://schema.org", "@type": "Organization", "name": "Brainscape", "url": "https://www.brainscape.com/", "logo": "https://www.brainscape.com/pks/images/cms/public-views/shared/Brainscape-logo-c4e172b280b4616f7fda.svg", "sameAs": [ "https://www.facebook.com/Brainscape", "https://x.com/brainscape", "https://www.linkedin.com/company/brainscape", "https://www.instagram.com/brainscape/", "https://www.tiktok.com/@brainscapeu", "https://www.pinterest.com/brainscape/", "https://www.youtube.com/@BrainscapeNY" ], "contactPoint": { "@type": "ContactPoint", "telephone": "(929) 334-4005", "contactType": "customer service", "availableLanguage": ["English"] }, "founder": { "@type": "Person", "name": "Andrew Cohen" }, "description": "Brainscape’s spaced repetition system is proven to DOUBLE learning results! Find, make, and study flashcards online or in our mobile app. Serious learners only.", "address": { "@type": "PostalAddress", "streetAddress": "159 W 25th St, Ste 517", "addressLocality": "New York", "addressRegion": "NY", "postalCode": "10001", "addressCountry": "USA" } }

RUST Flashcards

costrutti particolari di rust (9 cards)

1
Q

Create an array

A

let arr: [i32; 5] = [1, 2, 3, 4, 5];

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Create a string

A

Only to read -> let s: &str;

To modify -> let s: String;
(String has string modification methods such as character insertion, string insertion, removal, clearing, contains, from str to String,…)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Multi dimensional array

A

let array: [[i64; 6] ;2];

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Pass reference read-only

A

fn(&var)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Pass reference to modify, without losing ownership

A

fn(&mut var)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Passing and returning arrays

A

let mut arr: [i32, 5];

fn(arr)

fn function (mut arr: [i32 ; 5]) -> [i32 ; 5]{
return arr;
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How create new asyncronous channel?

A

let (tx, rx) = mpsc::channel()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Cosa fa clone?

A

Prende self come argomento &self e ne ritorna il valore self

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly