pub fn upload_crate(
        &self,
        http_client: &Client,
        body: Vec<u8>,
        krate: &Crate,
        vers: &semver::Version,
    ) -> AppResult<()> {
        let path = Uploader::crate_path(&krate.name, &vers.to_string());
        let content = Cursor::new(body);
        let mut extra_headers = header::HeaderMap::new();
        extra_headers.insert(
            header::CACHE_CONTROL,
            header::HeaderValue::from_static(CACHE_CONTROL_IMMUTABLE),
        );
        self.upload(
            http_client,
            &path,
            content,
            "application/gzip",
            extra_headers,
            UploadBucket::Default,
        )
        .map_err(|e| internal(&format_args!("failed to upload crate: {}", e)))?;
        Ok(())
    }
/// Uploads a crate and returns the checksum of the uploaded crate file.
Uploads a crate and returns the checksum of the uploaded crate file.
Uploads a crate and returns the checksum of the uploaded crate file .
pub fn upload_crate(
        &self,
        http_client: &Client,
        body: Vec<u8>,
        krate: &Crate,
        vers: &semver::Version,
    ) -> AppResult<()> {
        let path = Uploader::crate_path(&krate.name, &vers.to_string());
        let content = Cursor::new(body);
        let mut extra_headers = header::HeaderMap::new();
        extra_headers.insert(
            header::CACHE_CONTROL,
            header::HeaderValue::from_static(CACHE_CONTROL_IMMUTABLE),
        );
        self.upload(
            http_client,
            &path,
            content,
            "application/gzip",
            extra_headers,
            UploadBucket::Default,
        )
        .map_err(|e| internal(&format_args!("failed to upload crate: {}", e)))?;
        Ok(())
    }
pub fn upload_crate ( & self , http_client : & Client , body : Vec < u8 > , krate : & Crate , vers : & semver :: Version , ) -> AppResult < ( ) > { let path = Uploader :: crate_path ( & krate . name , & vers . to_string ( ) ) ; let content = Cursor :: new ( body ) ; let mut extra_headers = header :: HeaderMap :: new ( ) ; extra_headers . insert ( header :: CACHE_CONTROL , header :: HeaderValue :: from_static ( CACHE_CONTROL_IMMUTABLE ) , ) ; self . upload ( http_client , & path , content , " " , extra_headers , UploadBucket :: Default , ) . map_err ( | e | internal ( & format_args ! ( " " e ) ) ) ? ; Ok ( ( ) ) }
Uploads a crate and returns the checksum of the uploaded crate file.
Uploads a crate and returns the checksum of the uploaded crate file .
&self
http_client
&Client
body
Vec<u8>
krate
&Crate
vers
&semver::Version