added missing documentation

This commit is contained in:
Christian Köllner 2020-04-18 15:28:12 +02:00
parent 62d5a7e9bd
commit c1e8ed6d65
3 changed files with 20 additions and 0 deletions

View File

@ -89,6 +89,11 @@ namespace Capnp
/// <exception cref="InvalidOperationException">The object type was already set to something different</exception>
public new void SetStruct(ushort dataCount, ushort ptrCount) => base.SetStruct(dataCount, ptrCount);
/// <summary>
/// Determines the underyling object to be a capability.
/// </summary>
/// <param name="capabilityIndex">Capability table index, or null to encode a null pointer</param>
/// <exception cref="InvalidOperationException">The object type was already set to something different</exception>
public new void SetCapability(uint? capabilityIndex) => base.SetCapability(capabilityIndex);
/// <summary>

View File

@ -156,6 +156,16 @@ namespace Capnp.Rpc
}
}
/// <summary>
/// Unwraps given capability. Unwrapping walks the chain of promised capabilities and awaits their resolutions,
/// until we get the finally resolved capability. If it is the capability, the method returns a null reference.
/// If the capability is broken (resolved to exception, dependent answer faulted or cancelled, RPC endpoint closed),
/// it throws an exception.
/// </summary>
/// <typeparam name="TInterface">Capability interface</typeparam>
/// <param name="cap">capability to unwrap</param>
/// <returns>Task returning the eventually resolved capability</returns>
/// <exception cref="RpcException">Capability is broken</exception>
public static async Task<TInterface?> Unwrap<TInterface>(this TInterface cap) where TInterface: class, IDisposable
{
using var proxy = cap as Proxy;

View File

@ -497,6 +497,11 @@ namespace Capnp
}
}
/// <summary>
/// Determines the underyling object to be a capability.
/// </summary>
/// <param name="capabilityIndex">Capability table index, or null to encode a null pointer</param>
/// <exception cref="InvalidOperationException">The object type was already set to something different</exception>
protected void SetCapability(uint? capabilityIndex)
{
if (capabilityIndex.HasValue)