Skip to documentation
SLOP

tiny.peer.Relay

Reference tiny.peer Relay

Defined in tiny.peer.

API (8)

Actions

Public operations.

Types and contracts

Public types and contracts.

Fields and members

Public fields and members.

No direct callersNo direct callstiny.peerRelay
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/peer/src/address.zig:34

zig
pub const Relay = struct {    bytes: [relay_host_bytes_max]u8,    len: u8,    port: u16,    pub const InitError: type = RelayInitError;    pub fn init(host_name: []const u8, port: u16) InitError!Relay {        if (host_name.len == 0) return error.HostEmpty;        if (host_name.len > relay_host_bytes_max) return error.HostTooLong;        for (host_name) |byte| {            if (!hostByteValid(byte)) return error.InvalidHost;        }        var result = Relay{            .bytes = @splat(0),            .len = @intCast(host_name.len),            .port = port,        };        @memcpy(result.bytes[0..host_name.len], host_name);        return result;    }    pub fn host(self: *const Relay) []const u8 {        std.debug.assert(self.len <= relay_host_bytes_max);        return self.bytes[0..self.len];    }    pub fn valid(self: *const Relay) bool {        if (self.len == 0 or self.len > relay_host_bytes_max) return false;        for (self.bytes[0..self.len]) |byte| {            if (!hostByteValid(byte)) return false;        }        return true;    }    pub fn eql(self: *const Relay, other: *const Relay) bool {        return self.port == other.port and std.mem.eql(u8, self.host(), other.host());    }};

Source: lib/peer/src/root.zig:23

zig
pub const Relay = address.Relay;
Called byCallsNo direct callersRelayhostRelayeql
Static calls · unresolved targets: 0 · external targets: 1.
Called byCallsNo direct callsRelayeqlRelayhost
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsAddressfromRelayprivate sourcelib.peer.src.addresshostByteValidRelayinit
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersprivate sourcelib.peer.src.addresshostByteValidRelayvalid
Static calls · unresolved targets: 0 · external targets: 0.

Audit

Definitions6
Public names6
Members3
Version26.7.0
Revisiondaab053ee433