Skip to content
프로젝트

소개

Serde.NET is a C# port of the popular Serde serialization library for Rust

개발 도구

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Serde.NET

Serde.NET is a port of the popular serde.rs Rust serialization/deserialization library to .NET.

For an overview, see Overview.

Start by adding the serde NuGet package:

dotnet add package serde

To generate serialization/deserialization info for a type, now do the following:

  1. Mark the type partial
  2. Add the [GenerateSerde] attribute
using Serde;
using Serde.Json;

string output = JsonSerializer.Serialize(new SampleClass());

// prints: {"X":3,"Y":"sample"}
Console.WriteLine(output);

var deserialized = JsonSerializer.Deserialize<SampleClass>(output);

// prints SampleClass { X = 3, Y = sample }
Console.WriteLine(deserialized);

[GenerateSerde]
partial record SampleClass
{
    // automatically includes public properties and fields
    public int X { get; init; } = 3;
    public string Y = "sample";
}

관련 프로젝트 살펴보기

불러오는 중…