Class HostBindingAttribute
- Namespace
- DotBoxD.Abstractions
- Assembly
- DotBoxD.Abstractions.dll
Marks a host-service method as a sandbox binding the DotBoxD.Kernels generator may call from verified kernel
IR. A kernel reaches the service through Host<THost>() or through a
constructor-injected service field (e.g. _world.GetHealth(id)); the generator lowers that call to a
CallExpression(, records bindingId, …)capability in the
manifest's required capabilities, and adds effects to the manifest's effects. The
host registers a matching binding (same id, capability, and effects) so install-time policy and
effect validation gate the call. Set IsAsync when that registered binding declares
asynchronous host work.
[AttributeUsage(AttributeTargets.Method|AttributeTargets.Property)]
public sealed class HostBindingAttribute : Attribute
- Inheritance
-
HostBindingAttribute
- Inherited Members
Constructors
HostBindingAttribute(string, string, SandboxEffect)
Marks a host-service method as a sandbox binding the DotBoxD.Kernels generator may call from verified kernel
IR. A kernel reaches the service through Host<THost>() or through a
constructor-injected service field (e.g. _world.GetHealth(id)); the generator lowers that call to a
CallExpression(, records bindingId, …)capability in the
manifest's required capabilities, and adds effects to the manifest's effects. The
host registers a matching binding (same id, capability, and effects) so install-time policy and
effect validation gate the call. Set IsAsync when that registered binding declares
asynchronous host work.
public HostBindingAttribute(string bindingId, string capability, SandboxEffect effects)
Parameters
bindingIdstringcapabilitystringeffectsSandboxEffect
Properties
BindingId
The sandbox binding id the call lowers to (e.g. host.world.getHealth).
public string BindingId { get; }
Property Value
Capability
The capability the call requires (e.g. game.world.monster.read.health).
public string Capability { get; }
Property Value
Effects
The sandbox effects the binding declares — must equal the registered binding's effects so the
manifest's effects match the verified entrypoint effects (a read is
SandboxEffect.Cpu | SandboxEffect.HostStateRead).
public SandboxEffect Effects { get; }
Property Value
IsAsync
True when the registered sandbox binding uses asynchronous host work even if its declared effects are otherwise ordinary read/write effects.
public bool IsAsync { get; set; }