pub struct AstStr(/* private fields */);Expand description
Ast string
Implementations§
Source§impl AstStr
impl AstStr
Sourcepub fn new(repr: impl Into<AstStrRepr>) -> Self
pub fn new(repr: impl Into<AstStrRepr>) -> Self
Creates a new ast string without any associated input range
Sourcepub fn from_input(input: Substr) -> Self
pub fn from_input(input: Substr) -> Self
Creates a new ast string from an input range
Sourcepub fn replace(&mut self, repr: impl Into<AstStrRepr>)
pub fn replace(&mut self, repr: impl Into<AstStrRepr>)
Replaces this ast string
Sourcepub fn repr(&self) -> &AstStrRepr
pub fn repr(&self) -> &AstStrRepr
Returns the inner representation of this string
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 string has newlines
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AstStr
impl<'de> Deserialize<'de> for AstStr
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AstStr
impl StructuralPartialEq for AstStr
Auto Trait Implementations§
impl Freeze for AstStr
impl RefUnwindSafe for AstStr
impl !Send for AstStr
impl !Sync for AstStr
impl Unpin for AstStr
impl UnsafeUnpin for AstStr
impl UnwindSafe for AstStr
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