tiny.preserves.Symbol
Defined in symbols.
A symbol's name, held as a byte slice.
API (3)
Actions
Public operations.
eql: Returns true whenaandbhave the same bytes.order: Returns the byte order ofa's name againstb's.
Fields and members
Public fields and members.
Source
Source: lib/preserves/src/symbols.zig:9
zig
/// A symbol's name, held as a byte slice. The package root's `isRecord` takes a label as one, and/// `symbolEql` compares one with a symbol's bytes. The struct is a separate type from a symbol/// value (`Value.symbol`), and the constants here are of this type.pub const Symbol = struct { /// The symbol's bytes. Every constant in this file points at a string literal, so the bytes /// live for the whole program. name: []const u8, /// Returns true when `a` and `b` have the same bytes. The file's test is its one caller. pub fn eql(a: Symbol, b: Symbol) bool { return std.mem.eql(u8, a.name, b.name); } /// Returns the byte order of `a`'s name against `b`'s. The file's test is its one caller. pub fn order(a: Symbol, b: Symbol) std.math.Order { return std.mem.order(u8, a.name, b.name); }};Source: lib/preserves/src/root.zig:141
zig
pub const Symbol = symbols.Symbol;Audit
| Definitions | 3 |
|---|---|
| Public names | 6 |
| Members | 1 |
| Version | 26.7.0 |
| Revision | daab053ee433 |