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 : AttributeInheritance
Section titled “Inheritance”object ← Attribute ← HostBindingAttribute
Inherited Members
Section titled “Inherited Members”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()
Constructors
Section titled “Constructors”HostBindingAttribute(string, string, SandboxEffect)
Section titled “ HostBindingAttribute(string, string, SandboxEffect)”public HostBindingAttribute(string bindingId, string capability, SandboxEffect effects)Parameters
Section titled “Parameters”bindingId string
capability string
effects SandboxEffect
HostBindingAttribute(string, SandboxEffect)
Section titled “ HostBindingAttribute(string, SandboxEffect)”public HostBindingAttribute(string capability, SandboxEffect effects)Parameters
Section titled “Parameters”capability string
effects SandboxEffect
Properties
Section titled “Properties”BindingId
Section titled “ BindingId”The sandbox binding id the call lowers to (e.g. host.world.getHealth).
public string BindingId { get; }Property Value
Section titled “Property Value”Capability
Section titled “ Capability”The capability the call requires (e.g. game.world.monster.read.health).
public string Capability { get; }Property Value
Section titled “Property Value”Effects
Section titled “ 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
Section titled “Property Value”IncludeReceiver
Section titled “ IncludeReceiver”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; }Property Value
Section titled “Property Value”IsAsync
Section titled “ 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; }Property Value
Section titled “Property Value”IsAutoBinding
Section titled “ IsAutoBinding”True when the binding id is derived from the annotated service method.
public bool IsAutoBinding { get; }