Skip to content

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 IR. A kernel reaches the service through DotBoxD.Abstractions.HookContext.Host or a constructor-injected service field; the generator lowers that call to a CallExpression(bindingId, …), records the capability and effects, and expects the host to register a matching binding. Set DotBoxD.Abstractions.HostBindingAttribute.IsAsync when that registered binding declares asynchronous host work.

[AttributeUsage(AttributeTargets.Method|AttributeTargets.Property)]
public sealed class HostBindingAttribute : Attribute

objectAttributeHostBindingAttribute

Attribute.Equals(object?), Attribute.GetCustomAttribute(Assembly, Type), Attribute.GetCustomAttribute(Assembly, Type, bool), Attribute.GetCustomAttribute(MemberInfo, Type), Attribute.GetCustomAttribute(MemberInfo, Type, bool), Attribute.GetCustomAttribute(Module, Type), Attribute.GetCustomAttribute(Module, Type, bool), Attribute.GetCustomAttribute(ParameterInfo, Type), Attribute.GetCustomAttribute(ParameterInfo, Type, bool), Attribute.GetCustomAttributes(Assembly), Attribute.GetCustomAttributes(Assembly, bool), Attribute.GetCustomAttributes(Assembly, Type), Attribute.GetCustomAttributes(Assembly, Type, bool), Attribute.GetCustomAttributes(MemberInfo), Attribute.GetCustomAttributes(MemberInfo, bool), Attribute.GetCustomAttributes(MemberInfo, Type), Attribute.GetCustomAttributes(MemberInfo, Type, bool), Attribute.GetCustomAttributes(Module), Attribute.GetCustomAttributes(Module, bool), Attribute.GetCustomAttributes(Module, Type), Attribute.GetCustomAttributes(Module, Type, bool), Attribute.GetCustomAttributes(ParameterInfo), Attribute.GetCustomAttributes(ParameterInfo, bool), Attribute.GetCustomAttributes(ParameterInfo, Type), Attribute.GetCustomAttributes(ParameterInfo, Type, bool), Attribute.GetHashCode(), Attribute.IsDefaultAttribute(), Attribute.IsDefined(Assembly, Type), Attribute.IsDefined(Assembly, Type, bool), Attribute.IsDefined(MemberInfo, Type), Attribute.IsDefined(MemberInfo, Type, bool), Attribute.IsDefined(Module, Type), Attribute.IsDefined(Module, Type, bool), Attribute.IsDefined(ParameterInfo, Type), Attribute.IsDefined(ParameterInfo, Type, bool), Attribute.Match(object?), Attribute.TypeId, object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

HostBindingAttribute(string, string, SandboxEffect)

Section titled “ HostBindingAttribute(string, string, SandboxEffect)”
public HostBindingAttribute(string bindingId, string capability, SandboxEffect effects)

bindingId string

capability string

effects SandboxEffect

HostBindingAttribute(string, SandboxEffect)

Section titled “ HostBindingAttribute(string, SandboxEffect)”
public HostBindingAttribute(string capability, SandboxEffect effects)

capability string

effects SandboxEffect

The sandbox binding id the call lowers to (e.g. host.world.getHealth).

public string BindingId { get; }

string

The capability the call requires (e.g. game.world.monster.read.health).

public string Capability { get; }

string

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; }

SandboxEffect

Includes the instance expression as argument zero when lowering an explicitly identified binding. This lets SDK value objects expose host-backed convenience methods while keeping the registered binding signature explicit: value.Check(arg) binds as Check(value, arg).

public bool IncludeReceiver { get; set; }

bool

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; }

bool

True when the binding id is derived from the annotated service method.

public bool IsAutoBinding { get; }

bool