Rust Ownership And Borrowing Explained Practice Exam
Question 1 of 50
Arc<T>
drop
Rc
&s
s: String
&s[..]
s.as_str()
Deref
&String
&str
T
noalias
&mut T
Drop
T: ?Sized
str
[T]
'static
{ }
Copy
Clone
.clone()
*
&T
&U
T: Deref<Target = U>
Send
Sync
PhantomData
linked-list
let
Parser
[..]
[a..]
[..b]
[a..b]
a
b
struct Ref<'a> { r: &'a i32 }
PhantomData<T>
&[T]
Box<[T]>
&'static str
&Vec<T>
Vec<T>: Deref<Target = [T]>
vec.iter()
Borrowed(&'a T) | Owned(<T as ToOwned>::Owned)
for x in collection
into_iter()
iter()
iter_mut()
Cell<T>
RefCell<T>
[1, 2, 3]
panic!
i32
(i32, i32)
String
pub trait Clone { fn clone(&self) -> Self; }
*const T
*mut T
match
&mut str
s.len()
Deref<Target = str>
Box<T>
'a
ref mut
let Foo { ref mut x } = f;
x: &mut T
&mut [T]
&
&mut
let Foo { ref x } = f;
x: &T
x
f
T: 'a
Arc
bool
char
s1
upgrade()
Option<Rc<T>>
&(i32, i32)
for<'a> F: Fn(&'a T) -> &'a T
Cell
RefCell
fn drop(&mut self)
String::from("hello")
"hello".to_string()
Weak<T>
Ref
RefCell::borrow()
Rc<RefCell<T>>
Box
let mut x
ref
cell.set(x)
Question navigator