pub struct RawString(RawStringInner);
Expand description
Opaque string storage for raw TOML; internal to toml_edit
Tuple Fields§
§0: RawStringInner
Implementations§
source§impl RawString
impl RawString
pub(crate) fn with_span(span: Range<usize>) -> Self
sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
Access the underlying string
This generally requires a DocumentMut
.
sourcepub fn span(&self) -> Option<Range<usize>>
pub fn span(&self) -> Option<Range<usize>>
The location within the original document
This generally requires an ImDocument
.
pub(crate) fn to_str<'s>(&'s self, input: &'s str) -> &'s str
pub(crate) fn to_str_with_default<'s>( &'s self, input: Option<&'s str>, default: &'s str, ) -> &'s str
pub(crate) fn despan(&mut self, input: &str)
pub(crate) fn encode(&self, buf: &mut dyn Write, input: &str) -> Result
pub(crate) fn encode_with_default( &self, buf: &mut dyn Write, input: Option<&str>, default: &str, ) -> Result
Trait Implementations§
source§impl From<&InternalString> for RawString
impl From<&InternalString> for RawString
source§fn from(s: &InternalString) -> Self
fn from(s: &InternalString) -> Self
Converts to this type from the input type.
source§impl From<InternalString> for RawString
impl From<InternalString> for RawString
source§fn from(inner: InternalString) -> Self
fn from(inner: InternalString) -> Self
Converts to this type from the input type.
impl Eq for RawString
impl StructuralPartialEq for RawString
Auto Trait Implementations§
impl Freeze for RawString
impl RefUnwindSafe for RawString
impl Send for RawString
impl Sync for RawString
impl Unpin for RawString
impl UnwindSafe for RawString
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.