Function attr [src]
Prototype
pub fn attr(self: *Builder, attribute: Attribute) Allocator.Error!Attribute.Index Parameters
self: *Builderattribute: Attribute Source
pub fn attr(self: *Builder, attribute: Attribute) Allocator.Error!Attribute.Index {
try self.attributes.ensureUnusedCapacity(self.gpa, 1);
const gop = self.attributes.getOrPutAssumeCapacity(attribute.toStorage());
if (!gop.found_existing) gop.value_ptr.* = {};
return @enumFromInt(gop.index);
}