pub trait StringLike: Sealed + Sized {
// Required method
fn increment(self) -> Result<Self, Self>;
}Expand description
Types that can hold a valid UTF-8 string.
Required Methods§
Sourcefn increment(self) -> Result<Self, Self>
fn increment(self) -> Result<Self, Self>
Replace the last codepoint in the string with the next codepoint.
This operation will attempt to reuse the original memory.
If incrementing the last char fails, or if the string is empty, we return an Err with the original unmodified string.
§Errors
Returns Err(self) if the string is empty or if incrementing the last char overflows.
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.