Table of Contents

Class AdmissionPolicyFile

Namespace
MarymoorStudios.Core.Rpc.Identity.IO
Assembly
MarymoorStudios.Core.Rpc.Identity.IO.dll
public static class AdmissionPolicyFile
Inheritance
AdmissionPolicyFile
Inherited Members

Methods

Read<T>(FileProxy, ILoggerFactory, MemoryPool<byte>)

Reads the admission policy file and creates an AdmissionManager from it.

public static Promise<(UserIdentity Owner, T Manager)> Read<T>(FileProxy file, ILoggerFactory factory, MemoryPool<byte> pool) where T : AdmissionManager, IAdmissionManager<T, object?>

Parameters

file FileProxy

The file to read from.

factory ILoggerFactory

The logger factory for audits.

pool MemoryPool<byte>

The pool to allocate buffers from.

Returns

Promise<(UserIdentity Owner, T Manager)>

The manager.

Type Parameters

T

Exceptions

SerializationException

If file corruption is detected.

Read<T, TArg>(FileProxy, TArg, ILoggerFactory, MemoryPool<byte>)

Reads the admission policy file and creates an AdmissionManager from it.

public static Promise<(UserIdentity Owner, T Manager)> Read<T, TArg>(FileProxy file, TArg arg, ILoggerFactory factory, MemoryPool<byte> pool) where T : AdmissionManager, IAdmissionManager<T, TArg>

Parameters

file FileProxy

The file to read from.

arg TArg

State passed to the admission manager constructor.

factory ILoggerFactory

The logger factory for audits.

pool MemoryPool<byte>

The pool to allocate buffers from.

Returns

Promise<(UserIdentity Owner, T Manager)>

The manager.

Type Parameters

T
TArg

Exceptions

SerializationException

If file corruption is detected.

Write(FileProxy, UserIdentity, AdmissionManager, MemoryPool<byte>)

Writes an admission policy file.

public static Promise Write(FileProxy file, UserIdentity owner, AdmissionManager manager, MemoryPool<byte> pool)

Parameters

file FileProxy

The file to write to.

owner UserIdentity

The owning identity of this policy.

manager AdmissionManager

The manager whose policy should be written.

pool MemoryPool<byte>

The pool to allocate buffers from.

Returns

Promise