pub struct SMLWriter<StrAsRef>{ /* private fields */ }
Implementations§
source§impl<StrAsRef> SMLWriter<StrAsRef>
impl<StrAsRef> SMLWriter<StrAsRef>
pub fn new(values: TreeNode<SMLElement<StrAsRef>>) -> Self
sourcepub fn indent_with(self, str: &str) -> Option<Self>
pub fn indent_with(self, str: &str) -> Option<Self>
Sets the indentation string to be used in the output. If the passed in str contains any non-whitespace characters, this call will fail and return None.
sourcepub fn with_end_keyword(self, str: Option<&str>) -> Self
pub fn with_end_keyword(self, str: Option<&str>) -> Self
Sets the end keyword to be used in the output. If the passed in string is the empty string “”, ‘-’ will be used instead.
sourcepub fn align_columns(self, alignment: ColumnAlignment) -> Self
pub fn align_columns(self, alignment: ColumnAlignment) -> Self
Sets the column alignment of the attributes’ generated WSV. The element alignment will be unaffected, but all attributes and their values will be aligned this way.
sourcepub fn to_string(self) -> Result<String, SMLWriterError>
pub fn to_string(self) -> Result<String, SMLWriterError>
Writes the values in this SMLWriter out to a String. This operation can fail if any of the values would result in an SML attribute or element where the name is the same as the “End” keyword. If that happens, you as the caller will receive an Err() variant of Result.
Auto Trait Implementations§
impl<StrAsRef> Freeze for SMLWriter<StrAsRef>where
StrAsRef: Freeze,
impl<StrAsRef> RefUnwindSafe for SMLWriter<StrAsRef>where
StrAsRef: RefUnwindSafe,
impl<StrAsRef> Send for SMLWriter<StrAsRef>where
StrAsRef: Send,
impl<StrAsRef> Sync for SMLWriter<StrAsRef>where
StrAsRef: Sync,
impl<StrAsRef> Unpin for SMLWriter<StrAsRef>where
StrAsRef: Unpin,
impl<StrAsRef> UnwindSafe for SMLWriter<StrAsRef>where
StrAsRef: UnwindSafe,
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