pub async fn write(
        &self,
        org: &str,
        bucket: &str,
        body: impl Stream<Item = impl WriteDataPoint> + Send + Sync + 'static,
    ) -> Result<(), RequestError> {
        let mut buffer = bytes::BytesMut::new();

        let body = body.map(move |point| {
            let mut w = (&mut buffer).writer();
            point.write_data_point_to(&mut w)?;
            w.flush()?;
            Ok::<_, io::Error>(buffer.split().freeze())
        });

        let body = Body::wrap_stream(body);

        Ok(self.write_line_protocol(org, bucket, body).await?)
    }
/// Write a `Stream` of `DataPoint`s to the specified organization and
/// bucket.
Write a `Stream` of `DataPoint`s to the specified organization and
bucket.
Write a ` Stream ` of ` DataPoint ` s to the specified organization and bucket .
pub async fn write(
        &self,
        org: &str,
        bucket: &str,
        body: impl Stream<Item = impl WriteDataPoint> + Send + Sync + 'static,
    ) -> Result<(), RequestError> {
        let mut buffer = bytes::BytesMut::new();
        let body = body.map(move |point| {
            let mut w = (&mut buffer).writer();
            point.write_data_point_to(&mut w)?;
            w.flush()?;
            Ok::<_, io::Error>(buffer.split().freeze())
        });
        let body = Body::wrap_stream(body);
        Ok(self.write_line_protocol(org, bucket, body).await?)
    }
pub async fn write ( & self , org : & str , bucket : & str , body : impl Stream < Item = impl WriteDataPoint > + Send + Sync + ' static , ) -> Result < ( ) , RequestError > { let mut buffer = bytes :: BytesMut :: new ( ) ; let body = body . map ( move | point | { let mut w = ( & mut buffer ) . writer ( ) ; point . write_data_point_to ( & mut w ) ? ; w . flush ( ) ? ; Ok :: < _ , io :: Error > ( buffer . split ( ) . freeze ( ) ) } ) ; let body = Body :: wrap_stream ( body ) ; Ok ( self . write_line_protocol ( org , bucket , body ) . await ? ) }
Write a `Stream` of `DataPoint`s to the specified organization and
bucket.
Write a ` Stream ` of ` DataPoint ` s to the specified organization and bucket .
&self
org
&str
bucket
&str
body
impl Stream<Item = impl WriteDataPoint> + Send + Sync + 'static
&self
org
&str
bucket
&str
body
impl Stream<Item = impl WriteDataPoint> + Send + Sync + 'static