tiny.peer.PeerId
Defined in tiny.peer.
API (5)
Actions
Public operations.
Types and contracts
Public types and contracts.
Fields and members
Public fields and members.
Source
Source: lib/peer/src/identity.zig:13
zig
pub const PeerId = struct { key: [key_bytes]u8, pub const ParseError: type = PeerIdParseError; pub fn format(self: PeerId, output: []u8) text.EncodeError![]const u8 { return text.encode(&self.key, output); } pub fn parse(source: []const u8) ParseError!PeerId { if (source.len != text_bytes) return error.InvalidLength; var key: [key_bytes]u8 = undefined; const decoded = text.decode(source, &key) catch return error.InvalidEncoding; if (decoded != key.len) return error.InvalidLength; return .{ .key = key }; } pub fn eql(self: PeerId, other: PeerId) bool { return std.mem.eql(u8, &self.key, &other.key); }};Source: lib/peer/src/root.zig:27
zig
pub const PeerId = identity.PeerId;Audit
| Definitions | 5 |
|---|---|
| Public names | 5 |
| Members | 1 |
| Version | 26.7.0 |
| Revision | daab053ee433 |