add more docs
This commit is contained in:
parent
24c8ce8b37
commit
25cfb15823
|
|
@ -100,6 +100,13 @@ impl From<IoError> for DecodingError {
|
||||||
///
|
///
|
||||||
/// This struct should rarely be used.
|
/// This struct should rarely be used.
|
||||||
/// In most cases, prefer the `decode_from` function.
|
/// In most cases, prefer the `decode_from` function.
|
||||||
|
///
|
||||||
|
/// ```no_run
|
||||||
|
/// let file = ...
|
||||||
|
/// let dr = bincode::rustc_serialize::DecoderReader::new(&mut file, SizeLimit::Infinite);
|
||||||
|
/// let result: T = Decodable::decode(&mut dr);
|
||||||
|
/// let bytes_red = dr.bytes_read();
|
||||||
|
/// ```
|
||||||
pub struct DecoderReader<'a, R: 'a> {
|
pub struct DecoderReader<'a, R: 'a> {
|
||||||
reader: &'a mut R,
|
reader: &'a mut R,
|
||||||
size_limit: SizeLimit,
|
size_limit: SizeLimit,
|
||||||
|
|
|
||||||
|
|
@ -154,6 +154,13 @@ pub type DeserializeResult<T> = Result<T, DeserializeError>;
|
||||||
///
|
///
|
||||||
/// This struct should rarely be used.
|
/// This struct should rarely be used.
|
||||||
/// In most cases, prefer the `decode_from` function.
|
/// In most cases, prefer the `decode_from` function.
|
||||||
|
///
|
||||||
|
/// ```no_run
|
||||||
|
/// let file = ...
|
||||||
|
/// let d = Deserializer::new(&mut file, SizeLimit::new());
|
||||||
|
/// serde::Deserialize::deserialize(&mut deserializer);
|
||||||
|
/// let bytes_read = d.bytes_read();
|
||||||
|
/// ```
|
||||||
pub struct Deserializer<'a, R: 'a> {
|
pub struct Deserializer<'a, R: 'a> {
|
||||||
reader: &'a mut R,
|
reader: &'a mut R,
|
||||||
size_limit: SizeLimit,
|
size_limit: SizeLimit,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue