pub enum AstStrRepr {
String(Substr),
Static(&'static str),
Char(char),
Spaces {
len: u16,
},
Indentation {
indent: Arc<str>,
newlines: usize,
depth: usize,
},
Join {
lhs: AstStr,
rhs: AstStr,
},
}Expand description
Ast string representation
Variants§
String(Substr)
String
Static(&'static str)
Static string
Char(char)
Single character
Spaces
Spaces
Indentation
Indentation
Join
Joined strings
Implementations§
Source§impl AstStrRepr
impl AstStrRepr
Sourcepub fn is_str_eq_to(&self, other: &Self) -> bool
pub fn is_str_eq_to(&self, other: &Self) -> bool
Returns if this repr has the same string as another
Sourcepub fn count_newlines(&self) -> usize
pub fn count_newlines(&self) -> usize
Returns the number of newlines in this string
Sourcepub fn has_newlines(&self) -> bool
pub fn has_newlines(&self) -> bool
Returns if this representation has newlines
Trait Implementations§
Source§impl ArenaData for AstStrRepr
impl ArenaData for AstStrRepr
fn with_arena<O>(f: impl FnOnce(&UnsafeCell<Arena<Self>>) -> O) -> O
Source§impl Clone for AstStrRepr
impl Clone for AstStrRepr
Source§fn clone(&self) -> AstStrRepr
fn clone(&self) -> AstStrRepr
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 AstStrRepr
impl Debug for AstStrRepr
Source§impl From<&'static str> for AstStrRepr
impl From<&'static str> for AstStrRepr
Source§impl From<Substr> for AstStrRepr
impl From<Substr> for AstStrRepr
Source§impl From<char> for AstStrRepr
impl From<char> for AstStrRepr
Source§impl PartialEq for AstStrRepr
impl PartialEq for AstStrRepr
impl Eq for AstStrRepr
impl StructuralPartialEq for AstStrRepr
Auto Trait Implementations§
impl Freeze for AstStrRepr
impl RefUnwindSafe for AstStrRepr
impl !Send for AstStrRepr
impl !Sync for AstStrRepr
impl Unpin for AstStrRepr
impl UnsafeUnpin for AstStrRepr
impl UnwindSafe for AstStrRepr
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