/// Creates a new document with serialized bytes from `contents`.
Creates a new document with serialized bytes from `contents`.
Creates a new document with serialized bytes from ` contents ` .
pub fn with_contents<S: SerializedCollection<Contents = S>>(
        id: u64,
        contents: &S,
    ) -> Result<Self, crate::Error> {
        let contents = <S as SerializedCollection>::serialize(contents)?;
        Ok(Self::new(id, contents))
    }
pub fn with_contents < S : SerializedCollection < Contents = S > > ( id : u64 , contents : & S , ) -> Result < Self , crate :: Error > { let contents = < S as SerializedCollection > :: serialize ( contents ) ? ; Ok ( Self :: new ( id , contents ) ) }
Creates a new document with serialized bytes from `contents`.
Creates a new document with serialized bytes from ` contents ` .
id
u64
contents
&S