pub trait StringFlags: Copy {
// Required methods
fn quote_style(self) -> Quote;
fn triple_quotes(self) -> TripleQuotes;
fn prefix(self) -> AnyStringPrefix;
fn is_unclosed(self) -> bool;
// Provided methods
fn is_triple_quoted(self) -> bool { ... }
fn quote_str(self) -> &'static str { ... }
fn quote_len(self) -> TextSize { ... }
fn opener_len(self) -> TextSize { ... }
fn closer_len(self) -> TextSize { ... }
fn as_any_string_flags(self) -> AnyStringFlags { ... }
fn display_contents(self, contents: &str) -> DisplayFlags<'_> { ... }
}Required Methods§
Sourcefn quote_style(self) -> Quote
fn quote_style(self) -> Quote
Does the string use single or double quotes in its opener and closer?
fn triple_quotes(self) -> TripleQuotes
fn prefix(self) -> AnyStringPrefix
fn is_unclosed(self) -> bool
Provided Methods§
Sourcefn is_triple_quoted(self) -> bool
fn is_triple_quoted(self) -> bool
Is the string triple-quoted, i.e., does it begin and end with three consecutive quote characters?
Sourcefn quote_str(self) -> &'static str
fn quote_str(self) -> &'static str
A str representation of the quotes used to start and close.
This does not include any prefixes the string has in its opener.
Sourcefn quote_len(self) -> TextSize
fn quote_len(self) -> TextSize
The length of the quotes used to start and close the string. This does not include the length of any prefixes the string has in its opener.
Sourcefn opener_len(self) -> TextSize
fn opener_len(self) -> TextSize
The total length of the string’s opener, i.e., the length of the prefixes plus the length of the quotes used to open the string.
Sourcefn closer_len(self) -> TextSize
fn closer_len(self) -> TextSize
The total length of the string’s closer.
This is always equal to self.quote_len(), except when the string is unclosed,
in which case the length is zero.
fn as_any_string_flags(self) -> AnyStringFlags
fn display_contents(self, contents: &str) -> DisplayFlags<'_>
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.