Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TransformationStatus enum from corefxlab #22845

Closed
stephentoub opened this issue Jul 18, 2017 · 11 comments
Closed

Add TransformationStatus enum from corefxlab #22845

stephentoub opened this issue Jul 18, 2017 · 11 comments
Labels
area-System.Runtime blocked Issue/PR is blocked on something - see comments
Milestone

Comments

@stephentoub
Copy link
Member

Based on corefxlab work, will be used by a variety of new corefx Span-based APIs. We need to re-review to make sure it's exactly what we want to bake in to the core of the framework

namespace System.Buffers // System?
{
    public enum TransformationStatus // TransformStatus?  TransformResult?
    {
        Done, // Success? Complete? Ok?
        DestinationTooSmall,
        NeedMoreSourceData, // SourceTooSmall?
        InvalidData
    }
}

cc: @terrajobst, @bartonjs, @KrzysztofCwalina, @ahsonkhan

@stephentoub stephentoub changed the title Add TransformStatus enum Add TransformationStatus enum Jul 18, 2017
@stephentoub stephentoub changed the title Add TransformationStatus enum Add TransformationStatus enum from corefxlab Jul 18, 2017
@mellinoe
Copy link
Contributor

Regarding naming, I'd prefer the following:

  • "TransformResult", or something with "Result" in the name
  • "Success", rather than "Done"
  • "SourceTooSmall" -- symmetry with "DestinationTooSmall"

@stephentoub
Copy link
Member Author

stephentoub commented Jul 18, 2017

I'd prefer the following

In case it wasn't obvious from my comments I added to the type, me too ;)

@KrzysztofCwalina
Copy link
Member

KrzysztofCwalina commented Aug 30, 2017

I have used this enums in some contexts that were not transformations, e.g. in a routine that copies data from one buffer to another. Because of that, the currently proposed name is BufferOperationStatus, or even OperationStatus.

cc: @shiftylogic

@ahsonkhan
Copy link
Contributor

the currently proposed name is BufferOperationStatus, or even OperationStatus.

Given the naming feedback:

"TransformResult", or something with "Result" in the name

Should the enum be named BufferOperationResult or OperationResult instead?

@KrzysztofCwalina
Copy link
Member

I named it Status because I thought it implies current state of an ongoing operation (multiple calls to the method). Result to me implies more the final state.
But it might be splitting hair, and so I would be ok with either postfix

@karelz
Copy link
Member

karelz commented Oct 10, 2017

@KrzysztofCwalina I believe we are blocked on some of your TextEncoding APIs to show motivation for this one ...

@terrajobst
Copy link
Contributor

terrajobst commented Oct 31, 2017

Video

This is now tracked as part of other work item.

@ahsonkhan
Copy link
Contributor

For reference, here is the enum now:
https://github.com/dotnet/corefx/blob/master/src/System.Memory/src/System/Buffers/OperationStatus.cs#L11

namespace System.Buffers
{
    public enum OperationStatus
    {
        Done,
        DestinationTooSmall,
        NeedMoreData,
        InvalidData,
    }
}

Are we happy with the field names as is?

@karelz
Copy link
Member

karelz commented Nov 1, 2017

Where is the main API approval issue? I can't find it ...

@karelz
Copy link
Member

karelz commented Nov 21, 2017

@ahsonkhan @KrzysztofCwalina what is the main API issue tracking the proposal now?

@karelz
Copy link
Member

karelz commented Nov 21, 2017

FYI: The API review discussion was recorded - see https://youtu.be/bHwCPVNQLwo?t=99 (4 min duration)

@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the 2.1.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Runtime blocked Issue/PR is blocked on something - see comments
Projects
None yet
Development

No branches or pull requests

7 participants