async fn insert<Cn: Connection>(
        id: u64,
        contents: Self::Contents,
        connection: &Cn,
    ) -> Result<CollectionDocument<Self>, InsertError<Self::Contents>>
    where
        Self: Sized + 'static,
        Self::Contents: 'async_trait,
    {
        let header = match connection.collection::<Self>().insert(id, &contents).await {
            Ok(header) => header,
            Err(error) => return Err(InsertError { contents, error }),
        };
        Ok(CollectionDocument { header, contents })
    }
/// Inserts this value into the collection with the specified id, returning
/// the created document.
Inserts this value into the collection with the specified id, returning
the created document.
Inserts this value into the collection with the specified id returning the created document .
async fn insert<Cn: Connection>(
        id: u64,
        contents: Self::Contents,
        connection: &Cn,
    ) -> Result<CollectionDocument<Self>, InsertError<Self::Contents>>
    where
        Self: Sized + 'static,
        Self::Contents: 'async_trait,
    {
        let header = match connection.collection::<Self>().insert(id, &contents).await {
            Ok(header) => header,
            Err(error) => return Err(InsertError { contents, error }),
        };
        Ok(CollectionDocument { header, contents })
    }
async fn insert < Cn : Connection > ( id : u64 , contents : Self :: Contents , connection : & Cn , ) -> Result < CollectionDocument < Self > , InsertError < Self :: Contents > > where Self : Sized + ' static , Self :: Contents : ' async_trait , { let header = match connection . collection :: < Self > ( ) . insert ( id , & contents ) . await { Ok ( header ) => header , Err ( error ) => return Err ( InsertError { contents , error } ) , } ; Ok ( CollectionDocument { header , contents } ) }
Inserts this value into the collection with the specified id, returning
the created document.
Inserts this value into the collection with the specified id returning the created document .
id
u64
contents
Self::Contents
connection
&Cn
id
u64
contents
Self::Contents
connection
&Cn