Skip to documentation
SLOP

tiny.content.Sink

Reference tiny.content Sink

Defined in tiny.content.

Write capability over one provider, for a holder that may add bytes to a store and nothing else.

API (5)

Actions

Public operations.

Types and contracts

Public types and contracts.

Fields and members

Public fields and members.

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

Source

Source: lib/content/src/capability.zig:95

zig
/// Write capability over one provider, for a holder that may add bytes to a/// store and nothing else. The capability carries three things: an opaque/// context pointer for the provider, the capacity the store was built with, and/// a function table whose single entry publishes bytes. Publishing is its whole/// surface, so holding a Sink grants no way to read, look up, list, or delete.pub const Sink = struct {    context: *anyopaque,    capacity: model.Capacity,    vtable: *const VTable,    pub const VTable: type = SinkVTable;    /// Makes bytes retrievable under the reference a caller derived from them    /// by checking the bytes against the reference and then asking the provider    /// to publish them. The call rejects a reference whose extent is above the    /// object ceiling first, with `ContentExtentExceeded`, and verifies the    /// bytes against the reference next, so a length or digest disagreement    /// stops the call before the provider sees anything. The call returns the    /// provider's publication answer, `created` for new bytes and `exists_same`    /// for bytes already held under this reference.    pub fn put(        self: Sink,        reference: model.Reference,        bytes: []const u8,    ) PublicationError!Publication {        try self.capacity.validateReference(reference);        try reference.verify(bytes);        return self.vtable.put(self.context, reference, bytes);    }};

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

zig
pub const Sink = capability.Sink;
Called byCallsNo direct callersCapacityvalidateReferenceSinkput
Static calls · unresolved targets: 1 · external targets: 1.

Audit

Definitions3
Public names3
Members3
Version26.7.0
Revisiondaab053ee433