Trait to_arraystring::ToArrayString
source · pub trait ToArrayString: Copy {
type ArrayString: ArrayStringErased;
const MAX_LENGTH: usize;
// Required method
fn to_arraystring(self) -> Self::ArrayString;
}Expand description
A no-alloc version of ToString implemented for bool/integer/float types formatting into an ArrayString.
Required Associated Types§
sourcetype ArrayString: ArrayStringErased
type ArrayString: ArrayStringErased
An associated type to turn ArrayString’s const generic into a type generic,
working around limitations of the current type system.
This is always ArrayString, but in generic code this only usable as impl Deref<Target = str>.
Required Associated Constants§
sourceconst MAX_LENGTH: usize
const MAX_LENGTH: usize
The maximum length that Self can be formatted into. This is used for the capacity generic of ArrayString.
§Note for implementors
This must match the capacity generic used in ArrayString, otherwise logic bugs and panics may occur.
Required Methods§
sourcefn to_arraystring(self) -> Self::ArrayString
fn to_arraystring(self) -> Self::ArrayString
Returns the value’s formatted representation in an appropriately sized ArrayString.
Object Safety§
This trait is not object safe.