Skip to content

Prevent send::RequestContext::extract_v1 to take owner of self #183

Closed

Description

@jbesraa

extract_v1 signature takes full ownership of self
pub fn extract_v1(self) -> Result<(Request, ContextV1), CreateRequestError> {

This is tricky if we want to use it in the same scope with other functions that consume self, specifically in my case
I need to invoke it after invoking extract_v2 in the same function scope, while extract_v2 takes a reference self, extract_v1 takes full owner ship.

Activity

  1. DanGould commented on Jan 29, 2024

    @DanGould
    Member

    Seems like this makes cloning the default rather than exception.

    What if, where we run into ownership issues, we call req_ctx.clone().extract_v1() so that it's clone is only done in exceptional cases?

  2. jbesraa commented on Jan 31, 2024

    @jbesraa
    ContributorAuthor

    As send::RequextContext implements clone, we dont need this any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions