Skip to content

Stream does not implement Send #752

@kamlesh-nb

Description

@kamlesh-nb

I get the below error,

future cannot be sent between threads safely
the trait `Send` is not implemented for `(dyn Stream<Item = Result<ListDocumentsResponse<workspace::WorkSpace>, azure_core::error::Error>> + 'static)`
required for the cast to the object type `dyn Future<Output = Vec<workspace::WorkSpace>> + Send`rustc
cosmos_service.rs(57, 20): future is not `Send` as this value is used across an await
cosmos_service.rs(53, 19): consider moving this into a `let` binding to create a shorter lived borrow

Code:
let respo = self .client .list_documents() .into_stream::<WorkSpace>() .next() .await .unwrap().unwrap().documents;

Could someone please help me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions