Inform serializers about skipped fields.

Closes #960.
This commit is contained in:
Steven Fackler authored and Steven Fackler committed 2017-09-05 21:55:33 -07:00
1 parent d4042872f5
commit 2fe9a860cd
2 files changed
+35 -5

No files matched your search

+12
View File
@@ -1727,6 +1727,12 @@ pub trait SerializeStruct {
where
T: Serialize;
/// Indicate that a struct field has been skipped.
fn skip_field(&mut self, key: &'static str) -> Result<(), Self::Error> {
let _ = key;
Ok(())
}
/// Finish serializing a struct.
fn end(self) -> Result<Self::Ok, Self::Error>;
}
@@ -1772,6 +1778,12 @@ pub trait SerializeStructVariant {
where
T: Serialize;
/// Indicate that a struct variant field has been skipped.
fn skip_field(&mut self, key: &'static str) -> Result<(), Self::Error> {
let _ = key;
Ok(())
}
/// Finish serializing a struct variant.
fn end(self) -> Result<Self::Ok, Self::Error>;
}