Silk

silk/http_fetch_native

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, x86_64-unknown-linux-gnu.

Native ownership context for one-shot HTTP fetch operations.

Details

The context retains one immutable proxy policy through NativeRedirectClient. Fresh attempts therefore recompute the sealed route for every current URI before contact. An optional native pool handle is copied explicitly, sharing only its preallocated slot state and bounded immutable direct-route context.

Gotchas

The delivered native pool accepts direct TCP and Unix keys only. A fetch adapter must reject a configured pool when proxy recomputation selects forwarding or tunneling; it must not silently bypass the selected proxy or publish proxy credentials to a direct pool.

Import as FetchNative with import silk.http_fetch_native as FetchNative.

Public declarations: 1.

Context

pub struct Context<'configuration>

An immutable native route/acquisition context and optional compatible direct-pool capability.

Details

make consumes all fresh-acquisition settings without allocation. makeWithPool first constructs that exact fresh context, then fallibly copies the supplied pool handle. A failed copy publishes no partially initialized context and leaves the source handle valid.

Associated function Context.make

pub fn make<'configuration>(route: silk/http_proxy.Route<'configuration>, options: Options, limits: Limits) -> silk/http_fetch_native.Context<'configuration>

Owns one native fresh-acquisition context without a connection pool.

Associated function Context.makeWithPool

pub effect<'env> fn makeWithPool<'configuration: 'env, 'life1: 'env, 'env>(route: silk/http_proxy.Route<'configuration>, options: Options, limits: Limits, pool: &'life1 silk/http_connection_pool.Handle<silk/http_connection_pool.ConnectionKey, silk/http_client_native.NativeTransport, silk/http_connection_pool_native.Context>) -> silk/http_fetch_native.Context<'configuration> ! PoolError | TrustSourceError | OutOfMemoryError ? &mut Allocator

Owns one native fresh-acquisition context and a copied direct-pool capability.

Details

The copied handle retains the pool's already bounded immutable transport, HTTP, TLS, ALPN, and trust context. Route compatibility remains a per-attempt pre-contact admission check.

Method Context.hasPool

pub fn hasPool<'configuration, 'life1>(self: &'life1 Context<'configuration>) -> bool

Returns whether this context owns an explicit direct native pool capability.

Implementation silk/http_fetch.FetchClient<'policy, silk/http_client_native.NativeRouteProvider, silk/http_client_native.NativeTransport, A, HandlerError, silk/allocator.OutOfMemoryError | silk/http.ValueError | silk/http_client.ClientError | silk/http_client_native.NativeClientError | silk/http_connection_pool.PoolError | silk/http_origin.OriginError | silk/http_proxy.ProxyError | silk/http_request.RequestError | silk/https_identity.IdentityError | silk/native_socket.NativeSocketError | silk/resolver.ResolverError | silk/tls_connection.ConnectionError | silk/trust_snapshot.TrustSourceError, ? HandlerRequirements, ? &mut silk/allocator.Allocator | &mut silk/monotonic_clock.MonotonicClock | &mut silk/random.Random | &mut silk/system_clock.SystemClock | &mut silk/trust_source.TrustSource> for silk/http_fetch_native.Context<'configuration>

impl silk/http_fetch.FetchClient<'policy, silk/http_client_native.NativeRouteProvider, silk/http_client_native.NativeTransport, A, HandlerError, silk/allocator.OutOfMemoryError | silk/http.ValueError | silk/http_client.ClientError | silk/http_client_native.NativeClientError | silk/http_connection_pool.PoolError | silk/http_origin.OriginError | silk/http_proxy.ProxyError | silk/http_request.RequestError | silk/https_identity.IdentityError | silk/native_socket.NativeSocketError | silk/resolver.ResolverError | silk/tls_connection.ConnectionError | silk/trust_snapshot.TrustSourceError, ? HandlerRequirements, ? &mut silk/allocator.Allocator | &mut silk/monotonic_clock.MonotonicClock | &mut silk/random.Random | &mut silk/system_clock.SystemClock | &mut silk/trust_source.TrustSource> for silk/http_fetch_native.Context<'configuration>

Operation withAttempt

withAttempt = Context.impl@2.withAttempt

On this page