Skip to documentation
SLOP

tiny.peer.Capacity

Reference tiny.peer Capacity

Defined in tiny.peer.

API (6)

Actions

Public operations.

Types and contracts

Public types and contracts.

Fields and members

Public fields and members.

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

Source

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

zig
pub const Capacity = struct {    max_addresses: u8,    wire_bytes: u17,    text_bytes: u17,    storage_bytes: usize,    pub const DeriveError: type = CapacityDeriveError;    pub fn derive(limits: Limits) DeriveError!Capacity {        const bodies = std.math.mul(            usize,            limits.max_addresses,            address_wire_bytes_max,        ) catch return error.CapacityOverflow;        const wire_bytes = std.math.add(usize, wire_header_bytes, bodies) catch            return error.CapacityOverflow;        const text_body = text.encodedLength(wire_bytes);        const text_bytes = std.math.add(usize, text_prefix.len, text_body) catch            return error.CapacityOverflow;        const storage_bytes = std.math.mul(            usize,            limits.max_addresses,            @sizeOf(Address),        ) catch return error.CapacityOverflow;        return .{            .max_addresses = limits.max_addresses,            .wire_bytes = std.math.cast(u17, wire_bytes) orelse                return error.CapacityOverflow,            .text_bytes = std.math.cast(u17, text_bytes) orelse                return error.CapacityOverflow,            .storage_bytes = storage_bytes,        };    }};

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

zig
pub const Capacity = ticket.Capacity;
Called byCallsNo direct callersprivate sourcelib.peer.src.textencodedLengthCapacityderive
Static calls · unresolved targets: 0 · external targets: 0.

Audit

Definitions3
Public names3
Members4
Version26.7.0
Revisiondaab053ee433