ZeroC.Slice 0.3.1

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package ZeroC.Slice --version 0.3.1
NuGet\Install-Package ZeroC.Slice -Version 0.3.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ZeroC.Slice" Version="0.3.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ZeroC.Slice --version 0.3.1
#r "nuget: ZeroC.Slice, 0.3.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ZeroC.Slice as a Cake Addin
#addin nuget:?package=ZeroC.Slice&version=0.3.1

// Install ZeroC.Slice as a Cake Tool
#tool nuget:?package=ZeroC.Slice&version=0.3.1

The Slice serialization library

Slice is a serialization format for structured data: it allows you to encode structured data into streams of bytes and later decode these bytes to recreate the structured data.

Slice is also a modern Interface Definition Language (IDL): you define your structured data with the Slice IDL and then use the Slice compiler to generate code that encodes/decodes this structured data to/from bytes in Slice format.

In C#, the Slice compiler for C# generates code that relies on this Slice serialization library.

Unlike older C# libraries, Slice relies on System.Buffers (IBufferWriter<byte>, ReadOnlySequence<byte>) and is typically used with the Pipelines library.

Package | Source code | Documentation | API reference

Sample Code

// Slice definition

struct Person {
    name: string
    id: int32
    tag(1) email: string?
}
// Generated by the Slice compiler for C#

public partial record struct Person
{
    public string Name;

    public int Id;

    public string? Email;

    /// <summary>Constructs a new instance of <see cref="Person" />.</summary>
    public Person(string name, int id, string? email)
    {
        this.Name = name;
        ...
    }

    /// <summary>Constructs a new instance of <see cref="Person" /> and decodes its fields
    /// from a Slice decoder.</summary>
    /// <param name="decoder">The Slice decoder.</param>
    public Person(ref SliceDecoder decoder)
    {
        this.Name = decoder.DecodeString();
        ...
    }

    /// <summary>Encodes the fields of this struct with a Slice encoder.</summary>
    /// <param name="encoder">The Slice encoder.</param>
    public readonly void Encode(ref SliceEncoder encoder)
    {
        encoder.EncodeString(this.Name);
        ...
    }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

NuGet packages (2)

Showing the top 2 NuGet packages that depend on ZeroC.Slice:

Package Downloads
IceRpc The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

IceRPC for C#.

IceRpc.Slice The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

IceRpc.Slice for C#.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.3.1 285 3/28/2024
0.3.0 549 2/14/2024
0.2.1 386 12/12/2023
0.2.0 352 12/4/2023
0.1.2 413 10/9/2023
0.1.1 236 9/18/2023
0.1.0 265 9/6/2023