pub struct AnyStringFlags(/* private fields */);Implementations§
Source§impl AnyStringFlags
impl AnyStringFlags
pub fn with_prefix(self, prefix: AnyStringPrefix) -> Self
pub fn new( prefix: AnyStringPrefix, quotes: Quote, triple_quotes: TripleQuotes, ) -> Self
Sourcepub const fn is_u_string(self) -> bool
pub const fn is_u_string(self) -> bool
Does the string have a u or U prefix?
Sourcepub const fn is_raw_string(self) -> bool
pub const fn is_raw_string(self) -> bool
Does the string have an r or R prefix?
Sourcepub const fn is_interpolated_string(self) -> bool
pub const fn is_interpolated_string(self) -> bool
Does the string have an f,F,t, or T prefix?
Sourcepub const fn is_byte_string(self) -> bool
pub const fn is_byte_string(self) -> bool
Does the string have a b or B prefix?
pub fn with_quote_style(self, quotes: Quote) -> Self
pub fn with_triple_quotes(self, triple_quotes: TripleQuotes) -> Self
pub fn with_unclosed(self, unclosed: bool) -> Self
Trait Implementations§
Source§impl Clone for AnyStringFlags
impl Clone for AnyStringFlags
Source§fn clone(&self) -> AnyStringFlags
fn clone(&self) -> AnyStringFlags
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnyStringFlags
impl Debug for AnyStringFlags
Source§impl From<AnyStringFlags> for BytesLiteralFlags
impl From<AnyStringFlags> for BytesLiteralFlags
Source§fn from(value: AnyStringFlags) -> BytesLiteralFlags
fn from(value: AnyStringFlags) -> BytesLiteralFlags
Converts to this type from the input type.
Source§impl From<AnyStringFlags> for FStringFlags
impl From<AnyStringFlags> for FStringFlags
Source§fn from(value: AnyStringFlags) -> FStringFlags
fn from(value: AnyStringFlags) -> FStringFlags
Converts to this type from the input type.
Source§impl From<AnyStringFlags> for StringLiteralFlags
impl From<AnyStringFlags> for StringLiteralFlags
Source§fn from(value: AnyStringFlags) -> StringLiteralFlags
fn from(value: AnyStringFlags) -> StringLiteralFlags
Converts to this type from the input type.
Source§impl From<AnyStringFlags> for TStringFlags
impl From<AnyStringFlags> for TStringFlags
Source§fn from(value: AnyStringFlags) -> TStringFlags
fn from(value: AnyStringFlags) -> TStringFlags
Converts to this type from the input type.
Source§impl From<BytesLiteralFlags> for AnyStringFlags
impl From<BytesLiteralFlags> for AnyStringFlags
Source§fn from(value: BytesLiteralFlags) -> Self
fn from(value: BytesLiteralFlags) -> Self
Converts to this type from the input type.
Source§impl From<FStringFlags> for AnyStringFlags
impl From<FStringFlags> for AnyStringFlags
Source§fn from(value: FStringFlags) -> Self
fn from(value: FStringFlags) -> Self
Converts to this type from the input type.
Source§impl From<StringLiteralFlags> for AnyStringFlags
impl From<StringLiteralFlags> for AnyStringFlags
Source§fn from(value: StringLiteralFlags) -> Self
fn from(value: StringLiteralFlags) -> Self
Converts to this type from the input type.
Source§impl From<TStringFlags> for AnyStringFlags
impl From<TStringFlags> for AnyStringFlags
Source§fn from(value: TStringFlags) -> Self
fn from(value: TStringFlags) -> Self
Converts to this type from the input type.
Source§impl Hash for AnyStringFlags
impl Hash for AnyStringFlags
Source§impl PartialEq for AnyStringFlags
impl PartialEq for AnyStringFlags
Source§impl StringFlags for AnyStringFlags
impl StringFlags for AnyStringFlags
Source§fn 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
Source§fn 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?
Source§fn 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.Source§fn 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.
Source§fn 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.
Source§fn 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<'_>
impl Copy for AnyStringFlags
impl Eq for AnyStringFlags
impl StructuralPartialEq for AnyStringFlags
Auto Trait Implementations§
impl Freeze for AnyStringFlags
impl RefUnwindSafe for AnyStringFlags
impl Send for AnyStringFlags
impl Sync for AnyStringFlags
impl Unpin for AnyStringFlags
impl UnsafeUnpin for AnyStringFlags
impl UnwindSafe for AnyStringFlags
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more