attrs
Function parameters
Parameters
- self:*Builder
- attributes:[]Attribute.Index
Type definitions in this namespace
Types
Functions in this namespace
Functions
= 16
Values
Source
Implementation
pub fn attrs(self: *Builder, attributes: []Attribute.Index) Allocator.Error!Attributes {
std.sort.heap(Attribute.Index, attributes, self, struct {
pub fn lessThan(builder: *const Builder, lhs: Attribute.Index, rhs: Attribute.Index) bool {
const lhs_kind = lhs.getKind(builder);
const rhs_kind = rhs.getKind(builder);
assert(lhs_kind != rhs_kind);
return @intFromEnum(lhs_kind) < @intFromEnum(rhs_kind);
}
}.lessThan);
return @enumFromInt(try self.attrGeneric(@ptrCast(attributes)));
}