Skip to content

Determine if Response body is populated #1216

Closed
@bradleybeddoes

Description

@bradleybeddoes

I was looking through the api provided for Response for a way to determine if body has been populated (or not) by some other part of the application. I can't immediately see a way to do this however.

I note that body is an Option per https://github.com/hyperium/hyper/blob/master/src/http/response.rs#L15 so simply being able to access Option::is_some would suit my use case.

Alternatively Response could be extended with a bool that could be used to indicate by application code that the current response is considered to be 'committed' and probably should not be further altered.

I'd be happy to provide a PR for either (or both) but I wanted to find out if this would be palatable before proceeding.

Activity

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