Skip to documentation
SLOP

tiny.content.Extent

Reference tiny.content Extent

Defined in tiny.content.

An extent gives the exact byte length of one piece of content to size the buffer a read will fill.

API (3)

Actions

Public operations.

Fields and members

Public fields and members.

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

Source

Source: lib/content/src/model.zig:64

zig
/// An extent gives the exact byte length of one piece of content to size the/// buffer a read will fill. The struct holds that length as a `u32`, which puts/// the largest representable content at `maximum_extent_bytes`.pub const Extent = struct {    bytes: u32,    /// Converts a byte length a caller measured on the host into the extent a    /// reference carries, and returns `ContentExtentExceeded` when the length    /// is wider than the `u32` an extent holds.    pub fn fromUsize(bytes: usize) ReferenceError!Extent {        return .{            .bytes = std.math.cast(u32, bytes) orelse                return error.ContentExtentExceeded,        };    }    /// Widens an extent to the host's `usize`, for a caller slicing a buffer to    /// the content's length.    pub fn toUsize(self: Extent) usize {        return @intCast(self.bytes);    }};

Source: lib/content/src/root.zig:29

zig
pub const Extent = model.Extent;
Called byCallsNo direct callsReferencefromBytestest sourcelib.content.src.modeltest: content capacity accepts exact ...ExtentfromUsize
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callsReferenceverifyExtenttoUsize
Static calls · unresolved targets: 0 · external targets: 0.

Audit

Definitions3
Public names3
Members1
Version26.7.0
Revisiondaab053ee433