fn format_char_str(
s: &str,
length: Option<CharLength>,
fail_on_len: bool,
white_space: CharWhiteSpace,
) -> Result<String, Error>
Expand description
Returns s
as a String
with options to enforce char and varchar
semantics.
§Arguments
s
- Thestr
to formatlength
- An optional maximum length for the stringfail_on_len
- Return an error ifs
’s character count exceeds the specified maximum length.white_space
- Express how to handle trailing whitespace ons
This function should only fail when fail_on_len
is true
and length
is present and exceeded.