pub async fn create_parcel_from_file<D, I>(
        &self,
        bindle_id: I,
        parcel_sha: &str,
        data_path: D,
    ) -> Result<()>
    where
        I: TryInto<Id>,
        I::Error: Into<ClientError>,
        D: AsRef<Path>,
    {
        // Copy the path to avoid lifetime issues
        let data = data_path.as_ref().to_owned();
        let parsed_id = bindle_id.try_into().map_err(|e| e.into())?;
        debug!("Loading parcel data from {}", data.display());
        let stream = load::raw(data).await?;
        debug!("Successfully loaded parcel stream");
        let data_body = Body::wrap_stream(stream);

        self.create_parcel_request(
            self.create_parcel_builder(&parsed_id, parcel_sha)
                .body(data_body),
        )
        .await
    }
/// Same as [`create_parcel`](Client::create_parcel), but takes a path to the parcel
/// file. This will be more efficient for large files as it will stream the data into the body
/// rather than taking the intermediate step of loading the bytes into a `Vec`.
Same as [`create_parcel`](Client::create_parcel), but takes a path to the parcel
file. This will be more efficient for large files as it will stream the data into the body
rather than taking the intermediate step of loading the bytes into a `Vec`.
Same as [ ` create_parcel ` ] ( Client :: create_parcel ) but takes a path to the parcel file . This will be more efficient for large files as it will stream the data into the body rather than taking the intermediate step of loading the bytes into a ` Vec ` .
pub async fn create_parcel_from_file<D, I>(
        &self,
        bindle_id: I,
        parcel_sha: &str,
        data_path: D,
    ) -> Result<()>
    where
        I: TryInto<Id>,
        I::Error: Into<ClientError>,
        D: AsRef<Path>,
    {
        // Copy the path to avoid lifetime issues
        let data = data_path.as_ref().to_owned();
        let parsed_id = bindle_id.try_into().map_err(|e| e.into())?;
        debug!("Loading parcel data from {}", data.display());
        let stream = load::raw(data).await?;
        debug!("Successfully loaded parcel stream");
        let data_body = Body::wrap_stream(stream);
        self.create_parcel_request(
            self.create_parcel_builder(&parsed_id, parcel_sha)
                .body(data_body),
        )
        .await
    }
pub async fn create_parcel_from_file < D , I > ( & self , bindle_id : I , parcel_sha : & str , data_path : D , ) -> Result < ( ) > where I : TryInto < Id > , I :: Error : Into < ClientError > , D : AsRef < Path > , { // Copy the path to avoid lifetime issues let data = data_path . as_ref ( ) . to_owned ( ) ; let parsed_id = bindle_id . try_into ( ) . map_err ( | e | e . into ( ) ) ? ; debug ! ( " " data display ( ) ) ; let stream = load :: raw ( data ) . await ? ; debug ! ( " " ) ; let data_body = Body :: wrap_stream ( stream ) ; self . create_parcel_request ( self . create_parcel_builder ( & parsed_id , parcel_sha ) . body ( data_body ) , ) . await }
Same as [`create_parcel`](Client::create_parcel), but takes a path to the parcel
file.
Same as [ ` create_parcel ` ] ( Client :: create_parcel ) but takes a path to the parcel file .
&self
bindle_id
I
parcel_sha
&str
data_path
D
&self
bindle_id
I
parcel_sha
&str
data_path
D