Function std::is_readable

Overview
fn is_readable(value: any) -> bool

Test if the given value is readable.

A value is readable if can be acquired for shared access, such as producing an immutable reference.

A value that is moved is no longer considered readable.

Examples

let value = Some(42);
assert!(is_readable(value));
let value2 = value.map(|v| v + 1);
drop(value);
assert!(!is_readable(value));
assert_eq!(value2, Some(43));