-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a shared caching infrastructure for PolyType applications. (#68)
- Loading branch information
1 parent
fa1a51a
commit 085488b
Showing
41 changed files
with
2,062 additions
and
1,240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
src/PolyType.Examples/CborSerializer/Converters/DelayedCborConverter.cs
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
src/PolyType.Examples/CborSerializer/Converters/DelayedCborConverterFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using PolyType.Abstractions; | ||
using PolyType.Utilities; | ||
using System.Formats.Cbor; | ||
|
||
namespace PolyType.Examples.CborSerializer.Converters; | ||
|
||
internal sealed class DelayedCborConverterFactory : IDelayedValueFactory | ||
{ | ||
public DelayedValue Create<T>(ITypeShape<T> _) => new DelayedValue<CborConverter<T>>(self => new DelayedCborConverter<T>(self)); | ||
|
||
private sealed class DelayedCborConverter<T>(DelayedValue<CborConverter<T>> self) : CborConverter<T> | ||
{ | ||
public override T? Read(CborReader reader) | ||
=> self.Result.Read(reader); | ||
|
||
public override void Write(CborWriter writer, T? value) | ||
=> self.Result.Write(writer, value); | ||
} | ||
} |
Oops, something went wrong.