← All compilation units

Flyology.HTTP.Client.Request_Bodies

Description

Supplies bounded-memory request body sources for the HTTP client. Each source borrows its payload for the duration of Execute; the caller retains ownership and must not mutate or release it until Execute returns. These sources implement Rewindable_Request_Body_Source, so an idempotent request may replay once after a stale reused transport fails without response data.

Array_Source

type Array_Source
  (Data : not null access constant Ada.Streams.Stream_Element_Array)
is limited new Rewindable_Request_Body_Source with private;

Borrow a stream-element array without retaining a second complete body. Data must outlive the source and every Execute call using it.

Buffer_Source

type Buffer_Source
  (Data : not null access constant Flyology.Buffers.Unique_Buffer)
is limited new Rewindable_Request_Body_Source with private;

Borrow the readable payload of one acquired unique buffer. The source never transfers or releases the buffer's ownership token.

Byte_String_Source

type Byte_String_Source
  (Data : not null access constant String)
is limited new Rewindable_Request_Body_Source with private;

Borrow a byte string using the same one-character-to-one-octet mapping as Set_Body. This adapter does not perform character encoding.

Bytes_Source

type Bytes_Source
  (Data : not null access constant Flyology.Bytes.Unbounded_Bytes)
is limited new Rewindable_Request_Body_Source with private;

Borrow owned Flyology bytes without constructing another complete request body. Data must remain unchanged through Execute.

Declared_Length

function Declared_Length
  (Item : Array_Source) return Body_Length

@exclude

Parameters
Item

Array source to inspect

Return value

Exact array length

Declared_Length

function Declared_Length
  (Item : Buffer_Source) return Body_Length

@exclude

Parameters
Item

Unique-buffer source to inspect

Return value

Exact readable buffer length

Declared_Length

function Declared_Length
  (Item : Byte_String_Source) return Body_Length

@exclude

Parameters
Item

Byte-string source to inspect

Return value

Exact byte-string length

Declared_Length

function Declared_Length
  (Item : Bytes_Source) return Body_Length

@exclude

Parameters
Item

Owned-bytes source to inspect

Return value

Exact retained byte length

Read

procedure Read
  (Item     : in out Array_Source;
   Data     : out Ada.Streams.Stream_Element_Array;
   Last     : out Ada.Streams.Stream_Element_Offset;
   Finished : out Boolean;
   Timeout  : Duration;
   Token    : access Flyology.Cancellation.Token)

@exclude

Parameters
Item

Array source to advance

Data

Client staging array

Last

Last produced byte

Finished

Whether the array is exhausted

Timeout

Remaining exchange timeout

Token

Exchange cancellation token

Read

procedure Read
  (Item     : in out Buffer_Source;
   Data     : out Ada.Streams.Stream_Element_Array;
   Last     : out Ada.Streams.Stream_Element_Offset;
   Finished : out Boolean;
   Timeout  : Duration;
   Token    : access Flyology.Cancellation.Token)

@exclude

Parameters
Item

Unique-buffer source to advance

Data

Client staging array

Last

Last produced byte

Finished

Whether the buffer is exhausted

Timeout

Remaining exchange timeout

Token

Exchange cancellation token

Read

procedure Read
  (Item     : in out Byte_String_Source;
   Data     : out Ada.Streams.Stream_Element_Array;
   Last     : out Ada.Streams.Stream_Element_Offset;
   Finished : out Boolean;
   Timeout  : Duration;
   Token    : access Flyology.Cancellation.Token)

@exclude

Parameters
Item

Byte-string source to advance

Data

Client staging array

Last

Last produced byte

Finished

Whether the byte string is exhausted

Timeout

Remaining exchange timeout

Token

Exchange cancellation token

Read

procedure Read
  (Item     : in out Bytes_Source;
   Data     : out Ada.Streams.Stream_Element_Array;
   Last     : out Ada.Streams.Stream_Element_Offset;
   Finished : out Boolean;
   Timeout  : Duration;
   Token    : access Flyology.Cancellation.Token)

@exclude

Parameters
Item

Owned-bytes source to advance

Data

Client staging array

Last

Last produced byte

Finished

Whether the owned bytes are exhausted

Timeout

Remaining exchange timeout

Token

Exchange cancellation token

Rewind

procedure Rewind (Item : in out Array_Source)

Rewind an array source for an explicit later Execute call. Execute can also invoke this operation for its guarded stale-transport retry.

Parameters
Item

Source whose cursor returns to its first byte

Rewind

procedure Rewind (Item : in out Buffer_Source)

Rewind a unique-buffer source for an explicit later Execute call.

Parameters
Item

Source whose cursor returns to its first byte

Rewind

procedure Rewind (Item : in out Byte_String_Source)

Rewind a byte-string source for an explicit later Execute call.

Parameters
Item

Source whose cursor returns to its first byte

Rewind

procedure Rewind (Item : in out Bytes_Source)

Rewind an owned-bytes source for an explicit later Execute call.

Parameters
Item

Source whose cursor returns to its first byte