FromUtf16Error in alloc::string - Rust
Description: A possible error value when converting a `String` from a UTF-16 byte slice.
Keywords: rust, rustlang, rust-lang, FromUtf16Error

# Struct alloc::string::FromUtf16Error
1.0.0[−][src]

    pub struct FromUtf16Error(_);

Expand description

A possible error value when converting a `String` from a UTF-16 byte slice.

This type is the error type for the `from_utf16` method on `String`.

# Examples

Basic usage:

    // 𝄞mu<invalid>ic
    let v = &[0xD834, 0xDD1E, 0x006d, 0x0075,
              0xD800, 0x0069, 0x0063];

    assert!(String::from_utf16(v).is_err());

Run

## Trait Implementations

[src]

### impl Debug for FromUtf16Error

[src]

#### fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

[src]

### impl Display for FromUtf16Error

[src]

#### fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

## Auto Trait Implementations

### impl RefUnwindSafe for FromUtf16Error

### impl Send for FromUtf16Error

### impl Sync for FromUtf16Error

### impl Unpin for FromUtf16Error

### impl UnwindSafe for FromUtf16Error

## Blanket Implementations

[src]

### impl<T> Any for T where
T: 'static + ?Sized,

[src]

#### pub fn type_id(&self) -> TypeId

Gets the `TypeId` of `self`. Read more

[src]

### impl<T> Borrow<T> for T where
T: ?Sized,

[src]

#### pub fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more

[src]

### impl<T> BorrowMut<T> for T where
T: ?Sized,

[src]

#### pub fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more

[src]

### impl<T> From<T> for T

[src]

#### pub fn from(t: T) -> T

Performs the conversion.

[src]

### impl<T, U> Into<U> for T where
U: From<T>,

[src]

#### pub fn into(self) -> U

Performs the conversion.

[src]

### impl<T> ToString for T where
T: Display + ?Sized,

[src]

#### pub default fn to_string(&Self) -> String

Converts the given value to a `String`. Read more

[src]

### impl<T, U> TryFrom<U> for T where
U: Into<T>,

#### type Error = Infallible

The type returned in the event of a conversion error.

[src]

#### pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.

[src]

### impl<T, U> TryInto<U> for T where
U: TryFrom<T>,

#### type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

[src]

#### pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.