kurrentdb/operation/set_stream_metadata

Build and decode set-stream-metadata operations.

Setting metadata is implemented by appending a $metadata JSON event to the metadata stream named $$<stream>. This module wraps the append operation so transports can use the same request/response flow as regular appends.

Values

pub fn request(
  client: kurrentdb.Client,
  stream stream_name: String,
  metadata metadata: stream_metadata.StreamMetadata,
  uuid id: uuid.Uuid,
  config config: append_to_stream.Configuration,
) -> request.Request(BitArray)

Build a request to set metadata for a stream.

The metadata is encoded as JSON and appended as a $metadata event to the stream’s metadata stream. The uuid argument is used as the event id for the metadata event.

pub fn response(
  response: response.Response(BitArray),
) -> Result(
  append_to_stream.Append,
  append_to_stream.ResponseError,
)

Decode a set-metadata response.

This is the same wire response as an append operation, so the result and error types are reused from append_to_stream.

Search Document