@@ -1170,7 +1170,8 @@ pub trait Serializer: Sized {
1170
1170
/// then a call to `end`.
1171
1171
///
1172
1172
/// The `name` is the name of the struct and the `len` is the number of
1173
- /// data fields that will be serialized.
1173
+ /// data fields that will be serialized. `len` does not include fields
1174
+ /// which are skipped with [`SerializeStruct::skip_field`].
1174
1175
///
1175
1176
/// ```edition2021
1176
1177
/// use serde::ser::{Serialize, SerializeStruct, Serializer};
@@ -1207,6 +1208,8 @@ pub trait Serializer: Sized {
1207
1208
/// The `name` is the name of the enum, the `variant_index` is the index of
1208
1209
/// this variant within the enum, the `variant` is the name of the variant,
1209
1210
/// and the `len` is the number of data fields that will be serialized.
1211
+ /// `len` does not include fields which are skipped with
1212
+ /// [`SerializeStructVariant::skip_field`].
1210
1213
///
1211
1214
/// ```edition2021
1212
1215
/// use serde::ser::{Serialize, SerializeStructVariant, Serializer};
@@ -1857,6 +1860,8 @@ pub trait SerializeStruct {
1857
1860
T : ?Sized + Serialize ;
1858
1861
1859
1862
/// Indicate that a struct field has been skipped.
1863
+ ///
1864
+ /// The default implementation does nothing.
1860
1865
#[ inline]
1861
1866
fn skip_field ( & mut self , key : & ' static str ) -> Result < ( ) , Self :: Error > {
1862
1867
let _ = key;
@@ -1919,6 +1924,8 @@ pub trait SerializeStructVariant {
1919
1924
T : ?Sized + Serialize ;
1920
1925
1921
1926
/// Indicate that a struct variant field has been skipped.
1927
+ ///
1928
+ /// The default implementation does nothing.
1922
1929
#[ inline]
1923
1930
fn skip_field ( & mut self , key : & ' static str ) -> Result < ( ) , Self :: Error > {
1924
1931
let _ = key;
0 commit comments