add some documentation
This commit is contained in:
parent
13d6db9280
commit
a79da97a46
@ -1,3 +1,6 @@
|
|||||||
|
//! Generic data structure deserialization framework.
|
||||||
|
//!
|
||||||
|
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
use xml::name::OwnedName;
|
use xml::name::OwnedName;
|
||||||
use xml::reader::{EventReader, ParserConfig, XmlEvent};
|
use xml::reader::{EventReader, ParserConfig, XmlEvent};
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
|
//! # YaSerDe
|
||||||
|
//!
|
||||||
|
//! YaSerDe is a framework for ***ser***ializing and ***de***serializing Rust data
|
||||||
|
//! structures efficiently and generically from and into XML.
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
extern crate xml;
|
extern crate xml;
|
||||||
@ -12,14 +17,18 @@ use xml::writer::XmlEvent;
|
|||||||
pub mod de;
|
pub mod de;
|
||||||
pub mod ser;
|
pub mod ser;
|
||||||
|
|
||||||
|
/// A **data structure** that can be deserialized from any data format supported by YaSerDe.
|
||||||
pub trait YaDeserialize: Sized {
|
pub trait YaDeserialize: Sized {
|
||||||
fn deserialize<R: Read>(reader: &mut de::Deserializer<R>) -> Result<Self, String>;
|
fn deserialize<R: Read>(reader: &mut de::Deserializer<R>) -> Result<Self, String>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A **data structure** that can be serialized into any data format supported by YaSerDe.
|
||||||
pub trait YaSerialize: Sized {
|
pub trait YaSerialize: Sized {
|
||||||
fn serialize<W: Write>(&self, writer: &mut ser::Serializer<W>) -> Result<(), String>;
|
fn serialize<W: Write>(&self, writer: &mut ser::Serializer<W>) -> Result<(), String>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// A **visitor** that can be implemented to retrieve information from source file.
|
||||||
pub trait Visitor<'de>: Sized {
|
pub trait Visitor<'de>: Sized {
|
||||||
/// The value produced by this visitor.
|
/// The value produced by this visitor.
|
||||||
type Value;
|
type Value;
|
||||||
|
|||||||
@ -1,3 +1,6 @@
|
|||||||
|
//! Generic data structure serialization framework.
|
||||||
|
//!
|
||||||
|
|
||||||
use std::io::{Cursor, Write};
|
use std::io::{Cursor, Write};
|
||||||
use std::str;
|
use std::str;
|
||||||
use xml;
|
use xml;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user