pub trait StringExtT: Sized {
// Required method
fn push_to_string(self, string: &mut Vec<u8>);
// Provided methods
fn push_to_string_with_separator(
self,
string: &mut Vec<u8>,
separator: impl SeparatorT,
) { ... }
fn to_string_ext(self) -> String { ... }
fn to_string_ext_with_sep(self, separator: impl SeparatorT) -> String { ... }
}Expand description
Trait for pushing any value that can be converted into str to StringExt
If needed, you can implement this trait for your own type.
Required Methods§
Sourcefn push_to_string(self, string: &mut Vec<u8>)
fn push_to_string(self, string: &mut Vec<u8>)
Push the value to the string.
Provided Methods§
Sourcefn push_to_string_with_separator(
self,
string: &mut Vec<u8>,
separator: impl SeparatorT,
)
fn push_to_string_with_separator( self, string: &mut Vec<u8>, separator: impl SeparatorT, )
Push the value to the string with a separator.
! Separator should implement SeparatorT
Sourcefn to_string_ext(self) -> String
fn to_string_ext(self) -> String
Encode the value to the string.
Sourcefn to_string_ext_with_sep(self, separator: impl SeparatorT) -> String
fn to_string_ext_with_sep(self, separator: impl SeparatorT) -> String
Push the value to the string with separator
! Separator should implement SeparatorT.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.