IceRpc.Slice 0.1.2

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package IceRpc.Slice --version 0.1.2
                    
NuGet\Install-Package IceRpc.Slice -Version 0.1.2
                    
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="IceRpc.Slice" Version="0.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IceRpc.Slice" Version="0.1.2" />
                    
Directory.Packages.props
<PackageReference Include="IceRpc.Slice" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IceRpc.Slice --version 0.1.2
                    
#r "nuget: IceRpc.Slice, 0.1.2"
                    
#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.
#addin nuget:?package=IceRpc.Slice&version=0.1.2
                    
Install as a Cake Addin
#tool nuget:?package=IceRpc.Slice&version=0.1.2
                    
Install as a Cake Tool

IceRPC + Slice integration

The IceRPC framework allows you to make RPCs with the serialization format and IDL of your choice.

The IceRpc.Slice assembly is part of the IceRPC + Slice integration: it helps the Slice compiler for C# implement Slice interfaces and operations for use with IceRPC.

Package | Source code | Documentation | Examples | API reference

Sample Code

// Slice contract

module VisitorCenter

/// Represents a simple greeter.
interface Greeter {
    /// Creates a personalized greeting.
    /// @param name: The name of the person to greet.
    /// @returns: The greeting.
    greet(name: string) -> string
}
// Client application

using IceRpc;
using VisitorCenter;

await using var connection = new ClientConnection(new Uri("icerpc://localhost"));

// GreeterProxy is a struct generated by the Slice compiler; its implementation uses
// IceRpc.Slice.
var greeterProxy = new GreeterProxy(connection);
string greeting = await greeterProxy.GreetAsync(Environment.UserName);

Console.WriteLine(greeting);

await connection.ShutdownAsync();
// Server application

using IceRpc;
using IceRpc.Features;
using IceRpc.Slice;
using VisitorCenter;

await using var server = new Server(new Chatbot());
server.Listen();

// Wait until the console receives a Ctrl+C.
await CancelKeyPressed;
await server.ShutdownAsync();

// Class IceRpc.Slice.Service is an IceRPC dispatcher. This dispatch is implemented by
// Chatbot and helper code provided by the IGreeterService interface generated by the
// Slice compiler.
internal class Chatbot : Service, IGreeterService
{
    public ValueTask<string> GreetAsync(
        string name,
        IFeatureCollection features,
        CancellationToken cancellationToken)
    {
        Console.WriteLine($"Dispatching greet request {{ name = '{name}' }}");
        return new($"Hello, {name}!");
    }
}
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on IceRpc.Slice:

Package Downloads
IceRpc.Locator

Locator interceptor for IceRPC

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.1 225 11/15/2024
0.4.0.1 214 9/17/2024
0.4.0 147 9/16/2024
0.3.1 2,923 3/28/2024
0.3.0 635 2/14/2024
0.2.1 617 12/12/2023
0.2.0 389 12/4/2023
0.1.2 385 10/9/2023
0.1.1 182 9/18/2023
0.1.0 205 9/6/2023