pub struct Decor {
prefix: Option<RawString>,
suffix: Option<RawString>,
}
Expand description
A prefix and suffix,
Including comments, whitespaces and newlines.
Fields§
§prefix: Option<RawString>
§suffix: Option<RawString>
Implementations§
source§impl Decor
impl Decor
sourcepub fn new(prefix: impl Into<RawString>, suffix: impl Into<RawString>) -> Self
pub fn new(prefix: impl Into<RawString>, suffix: impl Into<RawString>) -> Self
Creates a new decor from the given prefix and suffix.
pub(crate) fn prefix_encode( &self, buf: &mut dyn Write, input: Option<&str>, default: &str, ) -> Result
sourcepub fn set_prefix(&mut self, prefix: impl Into<RawString>)
pub fn set_prefix(&mut self, prefix: impl Into<RawString>)
Set the prefix.
pub(crate) fn suffix_encode( &self, buf: &mut dyn Write, input: Option<&str>, default: &str, ) -> Result
sourcepub fn set_suffix(&mut self, suffix: impl Into<RawString>)
pub fn set_suffix(&mut self, suffix: impl Into<RawString>)
Set the suffix.
pub(crate) fn despan(&mut self, input: &str)
Trait Implementations§
impl Eq for Decor
impl StructuralPartialEq for Decor
Auto Trait Implementations§
impl Freeze for Decor
impl RefUnwindSafe for Decor
impl Send for Decor
impl Sync for Decor
impl Unpin for Decor
impl UnwindSafe for Decor
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.