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
FileProxyThe file to read from.
factory
ILoggerFactoryThe 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
FileProxyThe file to read from.
arg
TArgState passed to the admission manager constructor.
factory
ILoggerFactoryThe 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
FileProxyThe file to write to.
owner
UserIdentityThe owning identity of this policy.
manager
AdmissionManagerThe manager whose policy should be written.
pool
MemoryPool<byte>The pool to allocate buffers from.