Primitive std::str

str
Expand description
string slice

Implementations

fn try_as_str_array(self) -> Option<S>

Attempts to convert the string slice into a string array.

Returns

  • [Option] - Some(str_array) if the lengths of the S str_array type and the string slice’s lengths match. Else None.

Examples

fn foo() {
    let string_slice = "abcd";
    let string_array: str[4] = a.try_as_str_array().unwrap();
}

Trait Implementations

fn hash(
self,
refmut state: Hasher,
)