Silk

silk/http_client_native

Profiles: aarch64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, x86_64-unknown-linux-gnu-no-libc.

Native connection acquisition for one HTTP origin and one serial client scope.

Details

HTTPS authenticates the original origin with explicit trust. Absolute deadlines are unchanged through resolution, connection, and TLS authentication. Synchronous hostname resolution rejects an overall deadline before dispatch. Cleanup closes without a flush or TLS shutdown.

Import as HttpClientNative with import silk.http_client_native as HttpClientNative.

Public declarations: 16.

NativeRoute

pub struct NativeRoute

The immutable transport route retained independently of the HTTP origin.

Method NativeRoute.isUnix

pub fn isUnix<'life0>(self: &'life0 NativeRoute) -> bool

Returns whether this route uses an explicit Unix socket path.

Method NativeRoute.path

pub fn path<'a>(self: &'a NativeRoute) -> &'a [u8]

Borrows the exact owned Unix path, or an empty slice for direct TCP.

Implementation Copy for NativeRoute

impl Copy for NativeRoute

NativeClientError

pub union NativeClientError

A native HTTP acquisition capability or option admission failure.

UnsupportedTarget

NativeClientError.UnsupportedTarget: NativeClientError

The selected target has no native HTTP acquisition implementation.

InvalidConnectOptions

NativeClientError.InvalidConnectOptions: NativeClientError

The native polling interval or attempt count is outside its finite accepted range.

UnsupportedDeadline

NativeClientError.UnsupportedDeadline: NativeClientError

Synchronous hostname resolution cannot honor the supplied overall deadline.

TrustRequired

NativeClientError.TrustRequired: NativeClientError

HTTPS owned acquisition requires one caller-prepared frozen trust snapshot.

AlpnMismatch

NativeClientError.AlpnMismatch { error: ConnectionError }: NativeClientError

Required HTTP/1.1 application protocol negotiation did not succeed.

Field error

pub error: ConnectionError

The complete TLS connection failure.

AlpnPolicy

pub enum AlpnPolicy

The HTTP version policy for TLS application protocol negotiation.

OptionalHttp11

OptionalHttp11 = 0

Offers only http/1.1 and permits an absent selection.

RequiredHttp11

RequiredHttp11 = 1

Requires the peer to select http/1.1.

Http10

Http10 = 2

Sends no ALPN extension for an HTTP/1.0-only peer.

Options

pub struct Options

Finite native acquisition and TLS authentication limits.

Field maximumAddresses

pub maximumAddresses: usize

Maximum number of resolved numeric addresses.

Field family

pub family: FamilySelection

Address family admitted by resolution.

Field noDelay

pub noDelay: bool

Whether the socket disables Nagle's algorithm.

Field pollIntervalNanoseconds

pub pollIntervalNanoseconds: u64

Native readiness polling interval in nanoseconds.

Field maximumAttempts

pub maximumAttempts: usize

Maximum native connection attempts.

Field deadline

pub deadline: silk/option.Option<silk/system_clock.Instant>

Absolute overall deadline on the active monotonic timeline.

Field handshakeNanoseconds

pub handshakeNanoseconds: u64

Maximum TLS authentication duration in nanoseconds.

Field tls

pub tls: ClientLimits

TLS protocol storage limits.

Field trust

pub trust: TrustLoadLimits

Explicit trust source load bounds.

Field alpn

pub alpn: AlpnPolicy

HTTP-only application protocol negotiation policy.

Associated function Options.defaults

pub fn defaults() -> Options

Returns finite defaults with no overall deadline and optional HTTP/1.1 negotiation.

NativeTransport

pub struct NativeTransport

The unavailable native transport type for an unsupported target.

Method NativeTransport.route

pub fn route<'life0>(self: &'life0 NativeTransport) -> NativeRoute

Returns empty route metadata; this target cannot acquire a native connection.

NativeRouteProvider

pub struct NativeRouteProvider

The unavailable routed native provider type for an unsupported target.

Implementation HttpTransport for NativeTransport

impl HttpTransport for NativeTransport

Operation readSomeRaw

readSomeRaw = NativeTransport.impl@1.readSomeRaw

Rejects reads because this target has no native connection.

Operation writeSomeRaw

writeSomeRaw = NativeTransport.impl@1.writeSomeRaw

Rejects writes because this target has no native connection.

Operation flush

flush = NativeTransport.impl@1.flush

Rejects flushing because this target has no native connection.

Operation close

close = NativeTransport.impl@1.close

Completes locally because no native resource exists.

Implementation HttpTransport for NativeRouteProvider

impl HttpTransport for NativeRouteProvider

Operation readSomeRaw

readSomeRaw = NativeRouteProvider.impl@2.readSomeRaw

Rejects reads because this target has no native connection.

Operation writeSomeRaw

writeSomeRaw = NativeRouteProvider.impl@2.writeSomeRaw

Rejects writes because this target has no native connection.

Operation flush

flush = NativeRouteProvider.impl@2.flush

Rejects flushing because this target has no native connection.

Operation close

close = NativeRouteProvider.impl@2.close

Completes locally because no native resource exists.

Implementation ByteDuplex for NativeRouteProvider

impl ByteDuplex for NativeRouteProvider

Operation readSomeRaw

readSomeRaw = NativeRouteProvider.impl@3.readSomeRaw

Rejects reads because this target has no native connection.

Operation writeSomeRaw

writeSomeRaw = NativeRouteProvider.impl@3.writeSomeRaw

Rejects writes because this target has no native connection.

Operation flushRaw

flushRaw = NativeRouteProvider.impl@3.flushRaw

Rejects flushing because this target has no native connection.

Operation shutdownWriteRaw

shutdownWriteRaw = NativeRouteProvider.impl@3.shutdownWriteRaw

Rejects write shutdown because this target has no native connection.

Operation closeRaw

closeRaw = NativeRouteProvider.impl@3.closeRaw

Completes locally because no native resource exists.

preflight

pub fn preflight<'life0, 'life1>(origin: &'life0 silk/http_origin.Origin, options: &'life1 silk/http_client_native.Options) -> silk/result.Result<(), silk/http_client_native.NativeClientError>

Returns the typed unsupported-target result before allocation or provider dispatch.

preflightProxyRoute

pub fn preflightProxyRoute<'configuration, 'life1, 'life2>(route: &'life1 silk/http_proxy.Route<'configuration>, options: &'life2 silk/http_client_native.Options) -> silk/result.Result<silk/http_origin.Origin, silk/http_client_native.NativeClientError | silk/http_proxy.ProxyError>

Returns unsupported-target before route inspection or provider dispatch.

acquireOwned

pub effect<'static> fn acquireOwned(origin: Origin, options: Options, limits: Limits, preparedTrust: silk/option.Option<silk/trust_snapshot.TrustSnapshot>, acquisitionDeadline: silk/option.Option<silk/system_clock.Instant>) -> silk/http_client.Connection<silk/http_client_native.NativeTransport> ! NativeClientError

Rejects owned native HTTP acquisition before inspecting inputs on this target.

admitUnixRoute

pub effect<'life0> fn admitUnixRoute<'life0>(path: &'life0 [u8]) -> NativeRoute ! NativeClientError

Rejects Unix route admission before inspecting the path on an unsupported target.

acquireUnixOwned

pub effect<'life0> fn acquireUnixOwned<'life0>(path: &'life0 [u8], origin: Origin, options: Options, limits: Limits, preparedTrust: silk/option.Option<silk/trust_snapshot.TrustSnapshot>, acquisitionDeadline: silk/option.Option<silk/system_clock.Instant>) -> silk/http_client.Connection<silk/http_client_native.NativeTransport> ! NativeClientError

Rejects owned Unix HTTP acquisition before inspecting inputs on this target.

withConnection

pub effect<'env> fn withConnection<A, E, ?R, H: 'env, 'env>(origin: Origin, options: Options, limits: Limits, handler: H) -> A ! E | NativeClientError ? R

Rejects native HTTP acquisition before allocation or provider dispatch on this target.

withUnixConnection

pub effect<'env> fn withUnixConnection<A, E, ?R, H: 'env, 'life4: 'env, 'env>(path: &'life4 [u8], origin: Origin, options: Options, limits: Limits, handler: H) -> A ! E | NativeClientError ? R

Rejects Unix HTTP acquisition before allocation or provider dispatch on this target.

withProxyRoute

pub effect<'env> fn withProxyRoute<'configuration: 'env, A, E, ?R, H: 'env, 'env>(route: silk/http_proxy.Route<'configuration>, options: Options, limits: Limits, preparedTrust: silk/option.Option<silk/trust_snapshot.TrustSnapshot>, handler: H) -> A ! E | NativeClientError ? R where R in Without<R, &ByteDuplex>, R in Without<R, &HttpTransport>

Rejects routed native acquisition before allocation or provider dispatch on this target.

NativeRedirectClient

pub struct NativeRedirectClient<'configuration, 'policy, A, HandlerError, ?HandlerRequirements>

Rebuildable native route acquisition for bounded redirect operations.

Details

The initial sealed route retains the immutable proxy configuration. On supported native targets, every attempt recomputes policy for its current URI, completes method, target, header, and native-route preflight before destination contact, and replaces the stored option deadline with the operation's unchanged absolute deadline. Secure attempts load a fresh trust snapshot before acquisition; tunneled TLS continues to authenticate the original origin through withProxyRoute. Other targets fail with UnsupportedTarget before inspecting the request.

Associated function NativeRedirectClient.make

pub fn make<'configuration, 'policy, A, HandlerError, ?HandlerRequirements>(route: silk/http_proxy.Route<'configuration>, options: Options, limits: Limits) -> silk/http_client_native.NativeRedirectClient<'configuration, 'policy, A, HandlerError, ? HandlerRequirements>

Creates a reusable redirect attempt client from one policy-selected route.

Implementation silk/http_redirect.AttemptClient<'policy, silk/http_client_native.NativeRouteProvider, A, HandlerError, silk/http_client_native.NativeClientError, ? , ? HandlerRequirements> for silk/http_client_native.NativeRedirectClient<'configuration, 'policy, A, HandlerError, ? HandlerRequirements>

impl silk/http_redirect.AttemptClient<'policy, silk/http_client_native.NativeRouteProvider, A, HandlerError, silk/http_client_native.NativeClientError, ? , ? HandlerRequirements> for silk/http_client_native.NativeRedirectClient<'configuration, 'policy, A, HandlerError, ? HandlerRequirements>

Operation withAttempt

withAttempt = NativeRedirectClient.withAttemptUnsupported

route

pub fn route<'life0>(connection: &'life0 silk/http_client.Connection<silk/http_client_native.NativeTransport>) -> NativeRoute

Returns immutable native route metadata from an owned HTTP session without lending its transport mutably.

On this page