pub struct Model<T: NodeContent = RawNode>(_);
Expand description
Document interaction model.
Implementations
sourceimpl<T: NodeContent> Model<T>
impl<T: NodeContent> Model<T>
sourcepub fn parse(reader: BufReader<impl Read>) -> Result<Forest<T>, ParseTreeError>
pub fn parse(reader: BufReader<impl Read>) -> Result<Forest<T>, ParseTreeError>
Parse TREF document.
Arguments
reader
- BufReader to read the document.
Return
- A
Result
with aForest
or aParseTreeError
.
sourcepub fn serialize(
forest: &Forest<T>,
writer: &mut BufWriter<impl Write>
) -> Result<usize, SerializeTreeError>
pub fn serialize(
forest: &Forest<T>,
writer: &mut BufWriter<impl Write>
) -> Result<usize, SerializeTreeError>
Convert a Forest structure into a TREF document.
Arguments
forest
- Reference to aForest
.writer
- BufWriter where to write the TREF.
Return
- A
Result
with a number of lines writen or aSerializeTreeError
.
Auto Trait Implementations
impl<T> RefUnwindSafe for Model<T> where
T: RefUnwindSafe,
impl<T> Send for Model<T> where
T: Send,
impl<T> Sync for Model<T> where
T: Sync,
impl<T> Unpin for Model<T> where
T: Unpin,
impl<T> UnwindSafe for Model<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more