fn try_read(&self, blob_id: &str, mut buf: &mut [u8], offset: u64) -> Result<usize> {
        let query = &[];
        let (resource, url) = self.url(blob_id, query)?;

        let mut headers = HeaderMap::new();
        let end_at = offset + buf.len() as u64 - 1;
        let range = format!("bytes={}-{}", offset, end_at);
        headers.insert("Range", range.as_str().parse().map_err(|e| einval!(e))?);
        let headers = self.sign(Method::GET, headers, resource.as_str())?;

        // Safe because the the call() is a synchronous operation.
        let mut resp = self
            .request
            .call::<&[u8]>(Method::GET, url.as_str(), None, headers, true)
            .map_err(|e| epipe!(format!("oss req failed {:?}", e)))?;

        resp.copy_to(&mut buf)
            .map_err(|err| epipe!(format!("oss read failed {:?}", err)))
            .map(|size| size as usize)
    }
/// read ranged data from oss object
read ranged data from oss object
read ranged data from oss object
fn try_read(&self, blob_id: &str, mut buf: &mut [u8], offset: u64) -> Result<usize> {
        let query = &[];
        let (resource, url) = self.url(blob_id, query)?;
        let mut headers = HeaderMap::new();
        let end_at = offset + buf.len() as u64 - 1;
        let range = format!("bytes={}-{}", offset, end_at);
        headers.insert("Range", range.as_str().parse().map_err(|e| einval!(e))?);
        let headers = self.sign(Method::GET, headers, resource.as_str())?;
        // Safe because the the call() is a synchronous operation.
        let mut resp = self
            .request
            .call::<&[u8]>(Method::GET, url.as_str(), None, headers, true)
            .map_err(|e| epipe!(format!("oss req failed {:?}", e)))?;
        resp.copy_to(&mut buf)
            .map_err(|err| epipe!(format!("oss read failed {:?}", err)))
            .map(|size| size as usize)
    }
fn try_read ( & self , blob_id : & str , mut buf : & mut [ u8 ] , offset : u64 ) -> Result < usize > { let query = & [ ] ; let ( resource , url ) = self . url ( blob_id , query ) ? ; let mut headers = HeaderMap :: new ( ) ; let end_at = offset + buf . len ( ) as u64 - 1 ; let range = format ! ( " " offset end_at ) ; headers . insert ( " " , range . as_str ( ) . parse ( ) . map_err ( | e | einval ! ( e ) ) ? ) ; let headers = self . sign ( Method :: GET , headers , resource . as_str ( ) ) ? ; // Safe because the the call() is a synchronous operation. let mut resp = self . request . call :: < & [ u8 ] > ( Method :: GET , url . as_str ( ) , None , headers , true ) . map_err ( | e | epipe ! ( format ( " " e ) ) ) ? ; resp . copy_to ( & mut buf ) . map_err ( | err | epipe ! ( format ( " " err ) ) ) . map ( | size | size as usize ) }
read ranged data from oss object
read ranged data from oss object
&self
blob_id
&str
buf
&mut [u8]
offset
u64
&self
blob_id
&str
buf
&mut [u8]
offset
u64