tiny.http.ClientOperationCapacity
Defined in tiny.http.
API (11)
Actions
Public operations.
Fields and members
Public fields and members.
host_byteshost_bytes_per_operationoperation_countplain_read_bytesplain_read_bytes_per_operationplain_write_bytesplain_write_bytes_per_operationstorage_bytestarget_bytestarget_bytes_per_operation
Source
Source: lib/http/src/client/operation/model.zig:18
zig
pub const Capacity = struct { operation_count: usize, host_bytes_per_operation: usize, target_bytes_per_operation: usize, plain_read_bytes_per_operation: usize, plain_write_bytes_per_operation: usize, host_bytes: usize, target_bytes: usize, plain_read_bytes: usize, plain_write_bytes: usize, storage_bytes: usize, pub fn derive(limits: Limits) error{CapacityOverflow}!Capacity { const host_bytes = try alloc_phase.capacity.mul( usize, limits.operation_count, limits.host_bytes_per_operation, ); const target_bytes = try alloc_phase.capacity.mul( usize, limits.operation_count, limits.target_bytes_per_operation, ); const plain_read_bytes = try alloc_phase.capacity.mul( usize, limits.operation_count, limits.plain_read_bytes_per_operation, ); const plain_write_bytes = try alloc_phase.capacity.mul( usize, limits.operation_count, limits.plain_write_bytes_per_operation, ); const host_and_target_bytes = try alloc_phase.capacity.add( usize, host_bytes, target_bytes, ); const plain_bytes = try alloc_phase.capacity.add( usize, plain_read_bytes, plain_write_bytes, ); const storage_bytes = try alloc_phase.capacity.add( usize, host_and_target_bytes, plain_bytes, ); std.debug.assert(host_bytes <= storage_bytes); std.debug.assert(target_bytes <= storage_bytes); std.debug.assert(plain_read_bytes <= storage_bytes); std.debug.assert(plain_write_bytes <= storage_bytes); return .{ .operation_count = limits.operation_count, .host_bytes_per_operation = limits.host_bytes_per_operation, .target_bytes_per_operation = limits.target_bytes_per_operation, .plain_read_bytes_per_operation = limits.plain_read_bytes_per_operation, .plain_write_bytes_per_operation = limits.plain_write_bytes_per_operation, .host_bytes = host_bytes, .target_bytes = target_bytes, .plain_read_bytes = plain_read_bytes, .plain_write_bytes = plain_write_bytes, .storage_bytes = storage_bytes, }; }};Source: lib/http/src/root.zig:86
zig
pub const ClientOperationCapacity = client.OperationCapacity;Audit
| Definitions | 2 |
|---|---|
| Public names | 2 |
| Members | 10 |
| Version | 26.7.0 |
| Revision | daab053ee433 |