[API Proposal]: Implement IUtf8SpanParsable on Guid #105653
Labels
api-suggestion
Early API idea and discussion, it is NOT ready for implementation
needs-area-label
An area label is needed to ensure this gets routed to the appropriate area owners
Background and motivation
As part of #81500 :
Implement IUtf8SpanParsable on Guid. Additionally, add a utf8
Parse
andTryParse
that do not take the unusedIFormatProvider
parameter. This matches how ISpanParsable was implemented.Draft PR: #105654
API Proposal
API Usage
Alternative Designs
No response
Risks
There are a few aspects to this that I am unsure about.
IFormatProvider
parameter is unused, I thinkIUtf8SpanParsable
ought to be implemented explicitly. But that would not be consistent with theISpanParsable
implementation.ParseExact
andTryParseExact
also be added for consistency?Guid.Parse(string)
. It also has a constructor that takes aReadOnlySpan<byte>
, but this will not be equivalent to callingGuid.Parse(ReadOnlySpan<byte>)
, as that constructor deserializes from a binary representation of a Guid. Is this inconsistency a problem?The text was updated successfully, but these errors were encountered: