Trait TruncatingInto

Source
pub trait TruncatingInto<T>: Sealed {
    // Required method
    fn trunc_into(self) -> T;
}
Expand description

A sealed helper trait for calling FixedArray<T>::from_vec_trunc or FixedString::from_string_trunc.

Both of these functions may truncate the input in order to fit it into the provided ValidLength, therefore this trait must be imported in order to make possible truncation made obvious in user code.

Required Methods§

Source

fn trunc_into(self) -> T

Implementations on Foreign Types§

Source§

impl<LenT: ValidLength> TruncatingInto<FixedString<LenT>> for String

Source§

impl<T, LenT: ValidLength> TruncatingInto<FixedArray<T, LenT>> for Vec<T>

Source§

fn trunc_into(self) -> FixedArray<T, LenT>

Implementors§