Skip to content

put_block() with anything other than static data? #1219

@nlfiedler

Description

@nlfiedler

It appears that put_block() can only be called with data that has a static lifetime. How can I upload a file that I am reading into a buffer? Is this simply not possible at this point?

let mut file_handle = File::open(input_file)?;
let mut buffer: Vec<u8> = Vec::new();
file_handle.read_to_end(&mut buffer)?;
let response = blob_client.put_block("block1", &buffer[..]).into_future().await?;

rustc complains that buffer does not live long enough.

Metadata

Metadata

Assignees

Labels

StorageStorage Service (Queues, Blobs, Files)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions